http://poshcode.org/1393 - Test-ADCredentials by Mike Pfeiffer
Код:

Function Test-ADCredentials {
Param($username, $password, $domain)
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$ct = [System.DirectoryServices.AccountManagement.ContextType]::Domain
$pc = New-Object System.DirectoryServices.AccountManagement.PrincipalContext($ct, $domain)
New-Object PSObject -Property @{
UserName = $username;
IsValid = $pc.ValidateCredentials($username, $password).ToString()
}
}
Код:

PS > Test-ADCredentials TestUser 'P@$$w0rd1' 'contoso.ru'
IsValid UserName
------- --------
True TestUser
Или опишите задачу подробней, т.к. не очень понятно, что требуется в конечном итоге.