Iterate over AD users and find some properties (EmployeeNumber, ExtensionAttributes, manager,..)
Basically all in the title. I would like to connect to local AD server, and sync some user information.
Currently I have this, but it doesnt have the properties mentioned in the title
using (var principalContext = new PrincipalContext(ContextType.Domain))
{
var userPrinciple = new UserPrincipal(principalContext);
// Performe search for Domain users
using (var searchResult = new PrincipalSearcher(userPrinciple))
{
var allUsers = searchResult.FindAll();
...... process data....
}
}
4 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I am not sure if I tried it or not, but the problem is I don't have username/password, this is just something that would run on a windows server, without any login info
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
✅ This post has been marked as answered!