Archive for March, 2010

PowerShell find all Server 2008 boxes in a domain


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 […]

2 Comments

The 2010 Scripting Games are almost here!


I hope to compete this year, I’d suggest you do too šŸ™‚ Click the picture for more information

Leave a comment