There are several ways to do this. Here is a quick and easy function that authenticates the user for AD.
Function Test-ADAuthentication { param($username,$password) (new-object directoryservices.directoryentry "",$username,$password).psbase.name -ne $null } PS C:\> Test-ADAuthentication "dom\myusername" "mypassword" True PS C:\>
This may not be the best feature for your needs, but your question does not contain details.
source share