Last post Dec 26, 2013 12:30 AM by Angie xu - MSFT
Dec 19, 2013 12:43 PM|mnmhemaj|LINK
How to check if a user is in a Distribution Group (Not windows security group) in the Active Directory?
Dec 26, 2013 12:30 AM|Angie xu - MSFT|LINK
To achieve checking for if a user exists. You can use
PrincipalContext to authenticate user credentials,
public bool DoesUserExist(string userName)
using (var domainContext = new PrincipalContext(ContextType.Domain, "DOMAIN"))
using (var foundUser = UserPrincipal.FindByIdentity(domainContext, IdentityType.SamAccountName, userName))
return foundUser != null;
Moreover, you can also check relevant topics about
user existed in Active Directory asp.net online, more examples are available for you.