Skip to content

Instantly share code, notes, and snippets.

@jcefoli
Created August 2, 2020 05:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcefoli/df126f66e1c1553c1e78ec553312b65e to your computer and use it in GitHub Desktop.
Save jcefoli/df126f66e1c1553c1e78ec553312b65e to your computer and use it in GitHub Desktop.
Check if domain user is locked out
[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