What have you tried?

You generally want to use the ‘activedirectory’ module. and you use ‘set-aduser’ to set settings.
There is also a cmdlet called ‘rename-adobject’

https://docs.microsoft.com/en-us/powershell/module/addsadministration/rename-adobject?view=win10-ps

import-module ActiveDirectory
Set-ADUser -Identity $username #other stuff here
Rename-ADObject -Identity "CN=HQ,CN=Sites,CN=Configuration,DC=FABRIKAM,DC=COM" -NewName "UnitedKingdomHQ"

If you post code, please use the ‘Insert Code’ button. Please and thank you!

Feel free to post what you have and where you are stuck and we’ll try to help.

1 Spice up