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
Not sure that you can delete it since user objects usually follow a company schema but maybe something like the following will work:
userEntry.Properties["mail"] = null;
or maybe:
userEntry.Invoke("Put", "mail", null);
then:
userEntry.CommitChanges();
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();