Renaming AD Accounts
This method allows for just needing to do the below steps without worrying about losing profile settings or files ect.
Due to the current hybrid configuration we use with Office 365 email accounts, it is necessary to use Powershell to correctly change the User Principal Names (UPN) on user accounts. The process to do so is listed below.
1. Open Active Directory Users and Computers.
2. (Optional) It is recommended to Change Domain Controller to Omaha-dc03 to speed up the sync process after Step 7, otherwise you may need to wait 15 minutes for the AD changes to replicate between domain controllers.
3. Right-click on the user’s account and select Rename.
4. Type the new name and press Enter.
5. A new Rename User box will pop up allowing you to further change Full Name, First Name, Last Name, Display Name, User Logon Name, and User Logon Name (Pre-2000). Make sure all entries match the new name and that both User Logon Names match CVA’s naming convention of firstname.lastname. Verify the UPN suffix pulldown menu behind User Logon Name is set to “@cvacoop.com”.
6. Click OK to close the Rename User box.
7. Log into the csty-dirsync01.cvacoop.local server with an admin account. This server already has the necessary Azure and O365 Powershell modules installed for the next steps.
8. (Optional) To immediately sync the AD name changes to O365, run the “Force AD Sync.bat” file on the desktop. It will take about 2 minutes to finish. You will not see this progress in the command window, it runs in the background. If you do not force the sync, any AD changes (except passwords) are synced to O365 on the normal, minimum 30 minute schedule. You can verify the changes are done by going to the O365 Admin Center under Users – Active Users and locating the user’s account to view their settings.
9. Open Powershell on the server.
10. Change directory to C:\scripts.
11. Type .\” change O365 UPN.ps1” and press Enter. The “.\” is required.
12. Enter the user’s old UPN at the prompt (for example, “[email protected]” without quotes) and press Enter
13. Type the user’s new UPN at the prompt (for example, “[email protected]” without quotes) and press Enter.
14. The name change is now complete and you can close any open items. Assist the user with items affected by a UPN change such as logins, email profiles, Office activation, OneDrive, CVA-BYOD wifi, etc.