Test AD authentication with Powershell

A quick tip to test AD auth with Powershell:

$UserName = 'xxxx'
$Password = 'yyyy'

Function Test-ADAuthentication {
    param(
        $username,
        $password)
    
    (New-Object DirectoryServices.DirectoryEntry "",$username,$password).psbase.name -ne $null
}

Test-ADAuthentication -username $UserName -password $password

More articles

Free PDF creator

Stirling-PDF creator Why run your own docker instance of Stirling-PDF creator , you say? -No more paying Adobe and their overpriced

Read More »