Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Using Powershell to clean up Stale Computers

$
0
0

Basically what I want is all of the computers that have not authenticated in the last 30 days in a specific OU.  This following command works but is not exactly what I want.

Search-ADAccount-AccountInactive-ComputersOnly-SearchBase"OU=Test,DC=contoso,dc=com"-TimeSpan90.00:00:00|Format-TableName,ObjectClass-A

however, I would like the timestamp to show up as well and export it to excel. Anyone has any ideas?

I appreciate the help


Viewing all articles
Browse latest Browse all 6937

Trending Articles