Need help with Powershell script to update the "name" parameter in AD

Aniket Bhanse
Tera Guru

I have to update the "name" parameter in AD when the user is created in AD. We have OOB powershell script which creates user in AD. We have Orchestation setup to create/update users in AD. So inorder to update the "name" parameter, Servicenow has suggested a Support article https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0784931#:~:text=psm1
I have followed the same however I am getting an error:

AniketBhanse_0-1725370330471.png

 

 

The whole purpose of updating this is, we want the Name to be displayed as "Lastname, Firstname" in AD.

We were successfully able to update the Display name to be "Lastname, Firstname", but the "name" parameter is same as samaccountname. Samaccountname is {first letter of the first name + lastname) = "flastname". Even if we are updating the "name" parameter, the name is getting set as that of samaccountname. 
We cannot change the samaccountname as that is the unique key in AD.

Please help what solutions can be implemented.

0 REPLIES 0