I can successfully use Powershell to tell if a user authenticates in Active Directory:
Function Test-ADAuthentication {
param($username,$password)
(new-object directoryservices.directoryentry "",$username,$password).psbase.name -ne $null
}
Test-ADAuthentication "test" "Password1"
However, I cannot for the life of me figure out how to:
- Check if the password needs to be reset, while
- Verifying the credentials sent did work on their last password.
How could one go about this?