This project is read-only.

Rename Entry

Renaming an entry is done by using a ModifyDN operation. Because the common name makes up part of the distinguished name, it cannot be updated like a normal attribute. This operation will affect any entries below it as well.
Rename a Single Entry
string currentDn = "CN=Test User,CN=Users,DC=example,DC=com";

string newName = "Fake User";

string newDn = context.RenameEntry(currentDn, newName);
// newDn now equals "CN=Fake User,CN=Users,DC=example,DC=com"

User user = context.GetByDN<User>(newDn);
Rename a Container
string currentDn = "CN=Users,DC=example,DC=com";

string newName = "Fake Users";

string newDn = context.RenameEntry(currentDn, newName);
// newDn now equals "CN=Fake Users,DC=example,DC=com"

List<User> users = context.Query<User>(namingContext: newDn).ToList();

Last edited Jun 17, 2012 at 7:25 AM by MadHatter22, version 2