Skip to content

Instantly share code, notes, and snippets.

@jcefoli
Created October 15, 2019 03:37
Show Gist options
  • Save jcefoli/757f8a7871c1623db00ba633be6211a9 to your computer and use it in GitHub Desktop.
Save jcefoli/757f8a7871c1623db00ba633be6211a9 to your computer and use it in GitHub Desktop.
Conditionally Check for AD Locked Out User Account
[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