Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Trying to find all machines still running XP w/Powershell

$
0
0

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?

 


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>