我要为一个计算机对象移动到另一个OU我连接到另一个领域,我总是让收到COMException 转介从服务器返回的异常类型 和对象从不动!
I want to move a computer object to another OU I am connected to another domain and I always getting an exception of type ComException "A referral was returned from the server" and the object never move!
try { //I get the exception here computerObject.MoveTo(new DirectoryEntry("LDAP://OU=someOU,OU=parentOU,DC=test,DC=com")); computerObject.CommitChanges(); } catch (InvalidOperationException inOp) { //log } catch (COMException comEx) { //log } //joinPath.Close(); finally { computerObject.Close(); }有关疑难解答我改变了codeA点点,但再次它不工作。
for troubleshooting I changed the code a little bit but again it doesn't work.
computerObject.MoveTo(new DirectoryEntry("LDAP://OU=someOU,OU=parentOU,DC=test,DC=com"), "admin@test","somepassowrd",AuthenticationTypes.Secure));
新的异常类型是收到COMException 登录失败:未知的用户名或密码错误 我检查存在一个OU在活动目录中,我有足够的权限。
the new exception is of type ComException "Logon failure: unknown user name or bad password." I checked that there exists an OU in the active directory and I have enough permissions.
我跟着微软的文档在这里 https://开头msdn.microsoft/en-us/library/ms180856(v=vs.90).aspx 和许多计算器的问题。
I followed Microsoft docs here msdn.microsoft/en-us/library/ms180856(v=vs.90).aspx and many stackoverflow questions.
更新:我正在我的应用程序在一个域中,并在更改后的其他域的,这可能是问题的原因
Update: I am running my application in one domain and making changes in another domain, it might be the cause of the problem
推荐答案我出版了我的code在同一个域,它只是正常工作
I published my code in the same domain and it worked just fine
更多推荐
移动对象到OU在Active Directory
发布评论