The below code will help you to check the username and password of a user on a domain controller
System.DirectoryServices.AccountManagement.PrincipalContext PrincipalContext = new System.DirectoryServices.AccountManagement.PrincipalContext(System.DirectoryServices.AccountManagement.ContextType.Domain, "server");
bool AdsVlaid = PrincipalContext.ValidateCredentials("it", "13@mf3-25");
System.DirectoryServices.AccountManagement.PrincipalContext PrincipalContext = new System.DirectoryServices.AccountManagement.PrincipalContext(System.DirectoryServices.AccountManagement.ContextType.Domain, "server");
bool AdsVlaid = PrincipalContext.ValidateCredentials("it", "13@mf3-25");
No comments:
Post a Comment