I want to move active directory user from one organization unit to another using C#.
I have referred below links
- http://forums.asp.net/t/932664.aspx?Moving+an+AD+user+from+an+OU+to+another+OU
- http://www.nullskull.com/q/10279930/to-move-a-user-from-one-ou-to-another-ou.aspx
and tried below code, but it throws error
DirectoryEntry eLocation = new DirectoryEntry("LDAP://CN=Test User,OU=Users,OU=Development,DC=domain,DC=com");
DirectoryEntry nLocation = new DirectoryEntry("LDAP://OU=Users,OU=QC,DC=domain,DC=com");
eLocation.MoveTo(nLocation);
Above code throws below error
A referral was returned from the server.
Error code: -2147016661
Extended Error Message 0000202B: RefErr: DSID-0310082F, data 0, 1 access points
ref 1: 'domain.com'