Question : Powershell, get-qadcompter

I am running a script to see which computers haven't been logged on to within 30 days

get-qadcomputer -IncludeAllProperties | Where-Object { $_.lastlogon -lt (get-date).AddDays(-30) }

How can I run it to include only XP machines.

Thanks in advance

Answer : Powershell, get-qadcompter


Nice and easy:

get-qadcomputer -OperatingSystem "*XP*" -IncludeAllProperties | Where-Object { $_.lastlogon -lt (get-date).AddDays(-30) }

Do bear in mind that lastLogon is not replicated and may not give you a true picture if you have more than one Domain Controller.

HTH

Chris
Random Solutions  
 
programming4us programming4us