string path = "LDAP://192.168.0.20/CN=users,DC=company,DC=ltm,DC=dom";
DirectoryEntry dir = new DirectoryEntry(path, admin, pass, AuthenticationTypes.ServerBind);
object value = dir.Properties["description"].Value;
dir.Properties["description"].Value = "test";
dir.CommitChanges();
Код генерирует исключение COMException: «Неверный синтаксис DN» в dir.Properties [«description»]. Значение
Если я не укажу имя пользователя и пароль и заменю инициализацию DirectoryEntry на:
DirectoryEntry dir = new DirectoryEntry(path);
dir.AuthenticationType = AuthenticationTypes.ServerBind;
Затем я получаю исключение UnauthorizedAccessException в CommitChanges.
Любые идеи о том, что может быть не так, приветствуются.