Help with script to find computers by OS and have been inactive for 60 days

Solved

Powershell newb here, I have code snippets that do what I want but I can't find how to combine (if possible) them. Ideally I'd like to have a script that gave me XP boxes in AD that have been inactive for at least 60 days.

Code to find inactive computers:

Search-ADAccount -AccountInactive -ComputersOnly -TimeSpan 60.00:00:00

Code to find os type:

Get-ADComputer -Filter {OperatingSystem -Like "Windows XP*"} -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack -Wrap -Auto

Thanks for your help.

Posted Oct 14, 2013, 3:42 PM UTC · edited

1312
Loading comments…