How can we check whether the USERID exists in Active Directory or not.
I have LDAP String and UserID, can I find whether that UserID exists in Active Directory or not. I am using this for ASP.NET Web Application (.NET 3.5)
How can we check whether the USERID exists in Active Directory or not.
I have LDAP String and UserID, can I find whether that UserID exists in Active Directory or not. I am using this for ASP.NET Web Application (.NET 3.5)
You can do something along the lines of (replacing domain with the domain you're authenticating against or removing the parameter altogether):
To achieve checking for if a user exists. This comes from the
System.DirectoryServices.AccountManagement
namespace and assembly.You can find more information at http://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.aspx
You may want to check more into PrincipalContext as it has interesting methods for authenticating user credentials and such.
I would use the
System.DirectoryServices.AccountManagement
namespace.See http://msdn.microsoft.com/en-us/library/bb344891.aspx for more info