A client is looking to identify all remaining Windows 2000 and Windows XP machines in their domain and upgrade them. So, how do we track them down? Assuming they are part of the domain, we can query for computer objects with XP or 2000 in the OS name. Here is an example to gather just Windows 2000 boxes.
get-adcomputer -properties operatingsystem -filter ‘operatingsystem -like "*2000*"’
If the domain hasn’t been maintained and there are a lot of objects for long since retired machines, including the password last set date may be helpful. Just add
PasswordLastSet to the –properties argument.