Here's an example code snippet that demonstrates how to query Active Directory and retrieve employeeid using LDAP in C# using DirectorySearcher class from System.DirectoryServices:
709 chars19 lines
You can pass in the username, domain and ldapPath parameters to the method to retrieve the employeeid for that specific user from the Active Directory.
gistlibby LogSnag