How do I clear out a user object attribute in Active Directory?

前端 未结 2 1300
悲哀的现实
悲哀的现实 2021-01-04 12:14

Suppose you have connected to Active Directory using the simple syntax:

string adPath = \"LDAP://server.domain.com/CN=John,CN=Users,dc=domain,dc=com\";
Direc         


        
2条回答
  •  死守一世寂寞
    2021-01-04 12:47

    It turns out to be pretty simple, albeit not very commonly used...

    string adPath = "LDAP://server.domain.com/CN=John,CN=Users,dc=domain,dc=com";
    DirectoryEntry userEntry = Settings.GetADEntry(adPath);
    userentry.Properties["mail"].Clear();
    userentry.CommitChanges();
    

提交回复
热议问题