Wednesday, December 8, 2010

How to check the User credential of a user with a domain controller?

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");

No comments:

Post a Comment