Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get computer accounts that haven't logged on in a year.
$duration = (Get-Date).AddDays(-365)
Get-ADComputer -Filter {LastLogonDate -lt $duration} | Select-Object Name, LastLogonDate | Sort-Object Name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.