Archive for March, 2010
PowerShell find all Server 2008 boxes in a domain
Posted by Karl Mitschke in PowerShell, V1, V2 on March 30, 2010
This script will find all Server 2008 (and Server 2008 R2) machines on your domain: 001 002 003 004 005 006 007 008 009 010 011 012 013 $objDomain = [ADSI]” $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.Filter = "(&(objectCategory=computer)(operatingsystem=*Server 2008*))" $objSearcher.PageSize = 1000 $colProplist = "*" foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)} $colResults = $objSearcher.FindAll() $Server2008 = @() foreach ($objResult in $colResults) { $Server2008 += $objResult.Properties.name } You can change the operatingsystem= line to gather the OS you are interested […]
The 2010 Scripting Games are almost here!
Posted by Karl Mitschke in PowerShell on March 29, 2010
I hope to compete this year, Iād suggest you do too š Click the picture for more information