如何将用户从一个Activete目录移动到另一个 [英] How to Move User From one Activete Directory to Other
本文介绍了如何将用户从一个Activete目录移动到另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用C#.net将用户从一个Active目录移动到另一个AD.
我尝试了以下代码
I want to Move user from One Active directory to Other AD using C#.net.
I tried following code
DirectoryEntry deSourcedir = new DirectoryEntry(strFormPath, ConfigurationManager.AppSettings["Username"].ToString(), ConfigurationManager.AppSettings["Password"].ToString());
DirectoryEntry deDestinationdir = new DirectoryEntry(strTopath, ConfigurationManager.AppSettings["UsernameTarget"].ToString(), ConfigurationManager.AppSettings["PasswordTarget"].ToString(),AuthenticationTypes.Secure);
deSourcedir.MoveTo(deDestinationdir);
但是我遇到了追随错误
There is no such object on the server. (Exception from HRESULT: 0x80072030)
请帮忙....
But i am getting Following Error
There is no such object on the server. (Exception from HRESULT: 0x80072030)
Please help....
推荐答案
在下面的Code Project中检查此链接,看看是否对您有帮助:
如何:(几乎)通过C#实现Active Directory中的所有内容 [ ^ ]
Check this link below in Code Project, see if it helps you:
Howto: (Almost) Everything In Active Directory via C#[^]
在执行上述代码时,出现以下错误
服务器上没有这样的对象. (来自HRESULT的异常:0x80072030)
While executing the above code i am getting the following error
There is no such object on the server. (Exception from HRESULT: 0x80072030)
这篇关于如何将用户从一个Activete目录移动到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文