Authenticating with the help of System.DirectoryServices.AccountManagement

With the help of System.DirectoryServices.AccountManagement (available from .NET Framework 4.0) authenticating users against Microsoft Active Directory has become a lot simpler. Compare the below code public static bool IsAuthenticated( string domain, string username, string pwd ) { using ( PrincipalContext pc = new PrincipalContext( ContextType.Domain, domain) ) { return pc.ValidateCredentials( username, pwd ); } } to what you have to do previously public static bool IsAuthenticated(string domain, string username, string pwd) { string domainAndUsername = username + " [Read More]