Created
October 5, 2015 10:39
-
-
Save rycuda/b167adc2bb23fcc21792 to your computer and use it in GitHub Desktop.
Powershell to spit out stale (enabled) users and stale computers.
This file contains hidden or 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
Search-ADAccount -ComputersOnly -AccountInactive -timespan 30.00:00:00 | sort name | ft name,distinguishedname | |
Search-ADAccount -UsersOnly -AccountInactive -timespan 30.00:00:00 | Get-ADUser | Where-Object {$_.enabled} | sort name | ft name,distinguishedname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment