Skip to content

Instantly share code, notes, and snippets.

@i386net
Created May 11, 2021 10:27
Show Gist options
  • Save i386net/524552dd476bd9fce59eaa19d22925e8 to your computer and use it in GitHub Desktop.
Save i386net/524552dd476bd9fce59eaa19d22925e8 to your computer and use it in GitHub Desktop.
Find AD users with blank or weak passwords
Get-ADUser -Filter * -SearchBase "OU=some_ou,DC=some_domain,DC=local" | ForEach {
$_.SamAccountName
(new-object directoryservices.directoryentry "", ("domain\" + $_.SamAccountName), "123456").psbase.name -ne $null
Write-Host ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment