1

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

Moji
  • 5,720
  • 2
  • 38
  • 39
  • There is a similar question with helpful information: https://stackoverflow.com/questions/7408665/updating-name-field-on-userprincipal – Matt L Aug 09 '22 at 17:35
  • [There is a similar question with good responses:](https://stackoverflow.com/questions/7408665/updating-name-field-on-userprincipal) – Matt L Aug 09 '22 at 17:37

1 Answers1

1

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();
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Moji
  • 5,720
  • 2
  • 38
  • 39