Created
May 2, 2018 17:07
-
-
Save AshFlaw/b903ff300fb60f00d494a4de46f1aebc to your computer and use it in GitHub Desktop.
Get computer accounts that haven't logged on in a year.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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