Archive for May 5th, 2010

List all workstations in the domain

Here’s another quick oneliner I had to create for someone today and wanted to share with you:

Get-QADComputer -ComputerRole member -SizeLimit 0 -OSName 'Windows XP*', 'Windows 2000 Professional', 'Windows 7*', 'Windows Vista*'

The initial one-liner the customer was using was retrieving all Member computers but then using Where to filter by $_.operatingsystem whatever did not have Server in the name. This took longer (because Where is filtering on the client side after all objects are already retrieved) and resulted in extra computers being reported such as non-Windows storage systems.

Using cmdlet parameters makes sure that filtering is done during the object retrieval which is more efficient. And, as you can see, OSName parameter – as most parameters in QAD cmdlets – supports multiple values.

Depending on your environment you might want to modify the OS list to include Windows 8 or Mac OS 😉

If you want to get full list of operating systems in use in your company you would probably execute something like:

Get-QADComputer -SizeLimit 0 | group operatingsystem | sort Count -Descending

Hope this helps!

Advertisements

My Recent Tweets

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

May 2010
M T W T F S S
« Apr   Jun »
 12
3456789
10111213141516
17181920212223
24252627282930
31  
Advertisements

%d bloggers like this: