List stale Active Directory computer accounts using Windows PowerShell

I was trying to identify computer accounts that had not logged in within the last 6 months. To do that, I used theĀ get-adcomputer PowerShell cmd-let.

get-adcomputer -properties lastLogonDate -filter * | where { $_.lastLogonDate -lt (get-date).addmonths(-6) } | FT Name,LastLogonDate > c:\test.txt

Author: Eric Sarakaitis

I'm Eric, I love to cook, sing, garden and enjoy cold beverages!