How to Rename an Active Directory User with Active Directory Console?

How to Rename an Active Directory User with Active Directory Console?

You can rename user accounts in Active Directory in several ways. You can use AD graphical snap-ins, command-line tools, or PowerShell cmdlets.

How to Rename an Active Directory User with Active Directory Console?

The easiest and most intuitive way to rename an AD user is to use the Active Directory Users and Computers snap-in (ADUC).

  1. Open the ADUC console by running the dsa.msc command;
  2. Enable the following option in the top menu: View > Advanced Features;
  3. Use an Active Directory search to find the user you want to rename (or expand the Active Directory OU where the user locate manually);
  4. Open the user properties and go to the Object tab. The user’s full name is specified in the Canonical name of object field. This is the name that is displayed in the ADUC console and other Windows and AD tools;
    change username in active directory
  5. To rename a user, right-click on it and select Rename; rename active directory user
  6. In the window that opens, you can change the Full Name (Canonical name of object), First name, Last name, Display Name, as well as userPrincipalName and userlogonname (samAccountName/ pre-Windows 2000) attributes;
  7. Specify a new user name and save changes. rename ad user

You can also rename a user by manually editing the appropriate attributes on the Attribute Editor tab in the user’s properties.

active directory rename user account

How to Rename an Active Directory User with PowerShell?

You can use cmdlets from the PowerShell Active Directory module module to rename a user in AD. The base cmdlets are Rename-ADObject and Set-ADUser.

  • Rename-ADObject — allows you to change the values of the attributes: cn, distinguishedName, name;
  • Set-ADUser — allows you to change samAccountName, UPN, given name, surname, and other names of a user.

If you want to rename a user using Rename-ADObject, you must specify its DistinguishedName. For example:

Rename-ADObject –identity “CN=Olivia Williams,OU=Users,OU=California,OU=USA,DC=theitbros,DC=com” -NewName "Olivia Jones"

Hint. You can add the PowerShell whatIf parameter to a command to get information about the operation that the command will perform.

To make the command easier, you can get the user’s identity by name or samAccountName with the Get-ADUser cmdlet:

Get-Aduser O.Williams | Rename-ADObject -NewName "Olivia Jones"

You can use the Set-ADUser command to rename names in other user attributes.

List the available attributes and their values:

Get-ADUser o.Williams | fl *name*

rename ad user account

You can change other user settings with the Set-ADUser cmdlet. For example:

Get-ADUser o.Williams | Set-ADUser –displayname “Olivia Jones” –SamAccountName o.jones –Surname “Jones”

active directory rename user account

You can use the dsmove.exe command-line tool to rename a user. This syntax is used:

dsmove "" -newname ""

For example, let’s change Olivia’s last name:

dsmove.exe "CN=Olivia Williams,CN=Users,DC=theitbros,DC=com" -NewName "Olivia Jones"

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *