Created
August 17, 2018 12:19
-
-
Save seriald/b38c1028df73de3d487e5903e3728604 to your computer and use it in GitHub Desktop.
Count the number of Disabled AD users given an OU
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
$OU = Read-Host -Prompt 'Enter the OU' #Example: OU=IMB,OU=HQ,DC=intra,DC=pri | |
(Get-ADUser -Filter 'Enabled -eq $false' -searchbase "$OU").count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment