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。 DirectoryEntry初始化:LDAP DN语法无效
DirectoryEntry dir = new DirectoryEntry(path);
dir.AuthenticationType = AuthenticationTypes.ServerBind;
然后我在CommitChanges处得到UnauthorizedAccessException。
任何想法可能是错误的任何想法,不胜感激。
是的,但后来我得到一个DirectoryServicesCOMException告诉我,连接到这台机器设备不工作。 – remdao 2010-01-22 10:40:39
@remdao,是你的电脑加入到该域名? – Regent 2010-01-22 11:45:41
没有我所说的计算机有它自己的域名。我认为这是问题,谢谢你的帮助:) – remdao 2010-01-22 13:29:47