.Net Programming

How To Work With Active Directory (C#)

Active Directory is a little tricky when starting out. The recent project I worked on required me to add users (based on their NTAccounts) to a group. These users were not users of the machine, and therefore could not be found with UserPrincipal.FindByIdentity() for the machine you were adding the user on. What I knew about these users as that they had a Windows NTAccount andĀ the domain they belonged to. First I wanted to receive a datatablesĀ of NTAccount users from the active directory. I set up a Directory security class, which contains the directory’s group name and server I wanted…
Read more