Skip to content

Instantly share code, notes, and snippets.

@Rugby-Ball
Created July 3, 2023 17:01
Show Gist options
  • Save Rugby-Ball/56ba08c2cd7fc29058a3cd6e32af25b0 to your computer and use it in GitHub Desktop.
Save Rugby-Ball/56ba08c2cd7fc29058a3cd6e32af25b0 to your computer and use it in GitHub Desktop.
Used to test AD credentials. Function can be added to PowerShell $PROFILE #Security #Public #Utility #Active_Directory #Snippet #Function
Function Test-ADAuthentication {
param(
$username,
$password)
(New-Object DirectoryServices.DirectoryEntry "",$username,$password).psbase.name -ne $null
}
Test-ADAuthentication -username {Enter User Name} -password {Enter Password}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment