I am trying to pull all machines on my network still with XP. This is what I have
1 $Dom = 'LDAP://DC=contoso;DC=com'
2 $Root = New-Object DirectoryServices.DirectoryEntry $Dom
3
4 $i=0
5
6 # Create a selector and start searching from the Root of AD
7 $selector = New-Object Directory Services.DirectorySearcher
8 $selector.Searchroot = $root
9 $adobj= $selector.findall() | where {$_.properties.objectcategory -match "CN=computer"}
10
11 foreach ($client in $adobj)
Any help?