Andreaw T

Andreaw T

  • NA
  • 1
  • 0

C# How to Move a User from a Organization unit to another OU

Sep 4 2008 4:15 AM

Hi,

i'm trying to move an AD User from a OU to another OU in C#

This doesn't work...

public void AddToOU(string User, string OU)

{

DirectoryEntry ent = new DirectoryEntry("LDAP://DC=" + DC);

DirectoryEntry ou = ent.Children.Find("OU=" + OU);

DirectoryEntry group = ou.Children..Add("CN=" + User, "user");

group.CommitChanges();

}

 

Thank's