Created
August 2, 2020 05:37
-
-
Save jcefoli/df126f66e1c1553c1e78ec553312b65e to your computer and use it in GitHub Desktop.
Check if domain user is locked out
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
[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