Skip to content

Instantly share code, notes, and snippets.

@tschoonover
Last active April 20, 2017 18:35
Show Gist options
  • Save tschoonover/708b5540d70d3d8d2462e46af44dbb17 to your computer and use it in GitHub Desktop.
Save tschoonover/708b5540d70d3d8d2462e46af44dbb17 to your computer and use it in GitHub Desktop.
Check password with PowerShell
Function Test-ADAuthentication {
param($username,$password)
(new-object directoryservices.directoryentry "",$username,$password).psbase.name -ne $null
}
Test-ADAuthentication "DOMAIN\username" "password"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment