Created
October 15, 2019 03:37
-
-
Save jcefoli/757f8a7871c1623db00ba633be6211a9 to your computer and use it in GitHub Desktop.
Conditionally Check for AD Locked Out User Account
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
[bool]$isLocked = (Get-ADUser 'username' -Properties LockedOut).LockedOut | |
if ($isLocked -eq $True) { | |
Write-Host "Account is locked" | |
} else { | |
Write-Host "Account is not locked" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment