Well, this is very strange to me. I can add a user to Active directory via a custom component. However, I can not update an existing user. This code is part of a component I am writing. I get the unknown error at the line
**user.Properties["description"].Add("New description");
public void UpdateMe()
{
string path = "LDAP://10.xxx.xxx.x";
DirectoryEntry entry = new DirectoryEntry
path,"\\Administrator","password");
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(SAMAccountName=Test User)";
SearchResult result = search.FindOne();
DirectoryEntry user = result.GetDirectoryEntry();
user.Properties["description"].Add("New description");
user.Properties["givenName"].Value = "New Name";
user.CommitChanges();
entry.Close();
}
**user.Properties["description"].Add("New description");
public void UpdateMe()
{
string path = "LDAP://10.xxx.xxx.x";
DirectoryEntry entry = new DirectoryEntry
path,"\\Administrator","password");
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(SAMAccountName=Test User)";
SearchResult result = search.FindOne();
DirectoryEntry user = result.GetDirectoryEntry();
user.Properties["description"].Add("New description");
user.Properties["givenName"].Value = "New Name";
user.CommitChanges();
entry.Close();
}