- User first name: First (eg Joe)
- User last name: Last (eg Bloggs)
- User login name: firstl (eg joeb)
- User primary email: firstname.lastname@example.org (eg email@example.com)
How to change the UPN?So how did I change the UPN for those users to be the same as their primary email address? In the end I used PowerShell for Microsoft Online, and these are the steps I followed:
- Installed Microsoft Online Services Sign-In Assistant (IDCRL7) - 64 bit version
- Installed Microsoft Online Services Module for Windows PowerShell (64-bit version)
- Clicked the Microsoft Online Services Module shortcut to open a Windows PowerShell workspace
- Ran "connect-MSOLService" to connect to Microsoft Online (and entered username and password for Office 365 administrator account)
- Ran "Set-MsolUserPrincipalName -UserPrincipalName firstname.lastname@example.org -NewUserPrincipalName email@example.com"
How to change the primary email address?How about the account which had the wrong primary email address? For this one I needed to change the Proxy Addresses for the account, and because the Office 365 users were still synchronized with the on-premises Active Directory, I had to use ADSIEdit.msc to change the proxyAddresses attribute for that account, specifying SMTP in all-caps, for the address I wanted to use as the primary email address. I followed the instructions I found in Step 4 of the Solution in the following Microsoft KB article: http://support.microsoft.com/kb/2492140.
Here is a copy of the main steps from that KB article:
Use Active Directory Service Interfaces (ADSI) Edit to edit the proxyAddresses attribute of the user object so that it matches the primary SMTP address that you noted in step 1D. To do this, follow these steps:(It was this forum discussion that helped me get to the answer: http://community.office365.com/en-us/forums/158/t/44701.aspx)
Note The primary SMTP address value for the user object should be prepended by an uppercase "SMTP:" designator for the address value to be formatted correctly for the proxyAddresses attribute. For example, "SMTP:firstname.lastname@example.org" is an acceptable value, and "email@example.com" isn't an acceptable value. f.Click OK two times, and then exit ADSI Edit.
- Click Start, click Run, type ADSIEdit.msc, and then click OK.
- Right-click ADSI Edit, select Connect to, and then click OK to load the domain partition.
- In the navigation pane, locate the user object that you want to change, right-click it, and then click Properties.
- In the Attributes list, click the proxyAddresses attribute, and then click Edit.
- In the Value to add field, enter the appropriate SMTP address, and then click Add.