Click here to Skip to main content
15,921,793 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to Move user from One Active directory to Other AD using C#.net.

I tried following code

C#
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);


But i am getting Following Error

There is no such object on the server. (Exception from HRESULT: 0x80072030)

Please help....
Posted
Updated 21-Jun-12 20:42pm
v3

Check this link below in Code Project, see if it helps you:

Howto: (Almost) Everything In Active Directory via C#[^]
 
Share this answer
 
While executing the above code i am getting the following error




There is no such object on the server. (Exception from HRESULT: 0x80072030)
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900