Manoj
Manoj

Reputation: 6000

How to update AD User's Full name (Not Display Name) via c#

Existing answers confuse "Full name" with Display name. I can update AD user properties via c# (e.g. I can update First name, Last name, Display name) but not "Full name"

To see Full name search for a user in AD and in results right click on name and select Rename and "Full name" field is displayed along with name surname and display name

"Full name" is different from Display name (or name/surname or combinations) and can have different value. By default Full name is set to username and I need to change it to be same as display name.

Does anyone know how to update 'Full name' value using c#? Thanks

Upvotes: 2

Views: 1490

Answers (1)

Manoj
Manoj

Reputation: 6000

It is actually rename method that changes the full name, (or the name shown in results when queried via manual AD search.

string myNewValue = "mySurname, myFirstName".Replace(",", "\\,"); //escape comma
userDirectoryEntry.Rename("CN=" + myNewValue);
userDirectoryEntry.CommitChanges();

Upvotes: 2

Related Questions