浏览 2073 次
锁定老帖子 主题:C# 操作 AD 问题
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2012-12-21
在下面代码处 就出现 if (!DirectoryEntry.Exists(newLocationPath)) throw new EntryNotExistException("移动到的位置对象不存在。"); 这个异常: System.Runtime.InteropServices.COMException: 登录失败: 未知的用户名或错误密码。 在 System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) 在 System.DirectoryServices.DirectoryEntry.Bind() 在 System.DirectoryServices.DirectoryEntry.get_AdsObject() 在 System.DirectoryServices.PropertyValueCollection.PopulateList() 在 System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName) 在 System.DirectoryServices.PropertyCollection.get_Item(String propertyName) 即使我使用 DirectoryEntry de = new DirectoryEntry("LDAP://domain/OU=....dc=...", "domain/username", "pass", AuthenticationTypes.ServerBind); string test = de.Properties["cn"][0].ToString(); DirectoryEntry entry = new DirectoryEntry("("LDAP://domain/OU=another OU....dc=...", "domain/username", "pass", AuthenticationTypes.ServerBind); de.MoveTo(entry); 在MoveTo处也一样会报这个错误。 user和 password这些在客户端工具中都可以正常登录。 还麻烦大家帮忙看下。很急啊。 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |