Powershell command to change user Fullname

I have successfully used the following powershell script to modify the Diplay Name of existing users in our AD one specified OU at a time:

Get-ADUser -Filter * -SearchBase "OU containing users to change" -Properties DisplayName, Initials | % {Set-ADUser $_ -DisplayName ($_.Surname + ' ' + $_.GivenName + ' ' + $_.Initials)}  

I am trying to find a similar script that will apply the same change to the Full Name as well (the get-aduser property appears to be called just 'Name') but set-aduser doesn't appear to accept -Name or -FullName and I can't seem to find an equivilent in the help for set-aduser.  Does anyone have an alternative suggestion?  Would prefer powershell, but I want to be able to keep the script and use it to update users one OU at a time.
Who is Participating?
Adam BrownConnect With a Mentor Sr Solutions ArchitectCommented:
The Name attribute represents the actual CN= value of the user object, and can't be changed with set-aduser. You have to utilize the rename-adobject cmdlet to do this. The attached code would do it.
rename-adobject -identity (get-aduser <username>).distinguishedname -newname <new name>

Open in new window

PtboGiserAuthor Commented:
Perfect, thanks so much!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.