1. Create a connection to Active Directory /// ///Method used to create an entry to the AD. ///Replace the path, username, and password. /// ///DirectoryEntry publicstaticDirectoryEntry GetDirectoryEntry() { DirectoryEntry de = newDirectoryEntry(); de.Path = LDAP://192.168.1.1/CN=Users;DC=Yourdomain; de.Username = @"yourdomain\sampleuser"; de.Password = "samplepassword"; returnde; } 2. Create a ..