移动对象到OU在Active Directory

编程入门 行业动态 更新时间:2024-10-28 02:26:14
本文介绍了移动对象到OU在Active Directory的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我要为一个计算机对象移动到另一个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

本文发布于:2023-11-09 03:21:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571256.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对象   OU   Directory   Active

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!