Test d'authentification AD


Test-ADUserAuthentication

Test-ADUserAuthentication.ps1

$UserName = 'xxx'
$Password = 'xxxx'
Function Test-ADAuthentication {
    param(
        $username,
        $password)
    
    (New-Object DirectoryServices.DirectoryEntry "",$username,$password).psbase.name -ne $null
}
Test-ADAuthentication -username $UserName -password $password
[Console]::ReadKey()