It seems that everyone is way ahead of me in retiring Windows XP
computers. Yet, I didn't see any messages posted suggesting ways to
find Windows XP computers on a local network. I recently recalled
that one of the attributes for computer objects stored in Active
Directory is operatingSystem. I verified that the attribute was
populated and wrote the following query:
dsquery * dc=knet,dc=kbs,dc=msu,dc=edu -limit 0 -filter
"(&(objectClass=Computer)(operatingSystem=*XP*))" -attr cn
operatingSystem distinguishedName
The default limit is 100, and if the count is higher than 100
because you have computer objects for computers that have been
retired like I do, you might need to specify an override for the
default limit.
Since most administrators probably have fewer active Windows XP
computers in their domain than we have in ours, the above query is
probably not particularly useful in building your list of Windows XP
computers. However, it could be useful in removing XP computer
objects from your Active Directory.
DSQUERY seems to be included with Windows Server 2003 and higher.
Windows Server 2003 Support Tools can be installed on Windows XP to
get DSQUERY on Windows XP. On Windows 7 I think you need to turn on
the feature "AD DS Snap-ins and Command-line Tools" in "Programs and
Features" (appwiz.cpl control panel) "Turn Windows features on or
off" under Remote Server Administration Tools » Role Administration
Tools » AD DS and AD LDS Tools.
DSRM removes active directory objects identified by distinguished
name. Unlike dsget, dsadd, dsmod or dsquery, it does not use the
qualifiers "computer" "user" or "group".
If you edit your list of XP computers retrieved from Active
Directory and save the distinguished names of all the retired XP
computers to a text file, you can remove them from Active Directory
with a command like the following:
dsrm -noprompt < distinguishedNamesOfRetiredXPcomputers.txt
I wasn't sure that I trusted Active Directory to have correct
information for the operatingSystem attribute, so I checked some
computers that were upgraded from Windows XP or Windows Vista to
Windows 7. It looks like under normal circumstances the
operatingSystem attribute is updated when a computer is joined to a
domain.