Skip Navigation LinksRename-Objects

​How to rename a user from Office 365 portal and mailbox in Exchange Online using PowerShell Reusing a user ID / Rename a Microsoft Office 365 ID


 

 

Administrators hire & replace users in the organization for different reasons but, sometimes they need to keep both email addresses in only one mailbox. The best way to do it; is using the rename process to keep receiving emails from the old email address in the renamed mailbox. This can be accomplish because, after the rename process the old mailbox email address is added into the renamed mailbox as an alias with the commands below:


 

 

Connect both PowerShell (Windows Azure Active Directory for Windows PowerShell) and (Exchange online PowerShell) in one session.

Copy and paste the commands below:


 

 

$LiveCred = Get-Credential

Connect-MSOLservice –Credential $livecred

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection

Import-PSSession $Session


 

 

“Office 365 Global Credentials will be required”

After connect to Office 365 PowerShell, follow the process below:

 

        Gather the user/mailbox information to be modified using the command below:


 

 

To verify the all the important attributes were modified run the command below:
Get-Mailbox renamed@example.com |FL WindowsLiveID, MicrosoftOnlineServicesID, Identity, Name, WindowsEmailAddress, PrimarySmtpAddress, EmailAddresses, UserPrincipalName



 

 

To change the UPN and identity login for the user, run the command below:

Set-MsolUserPrincipalName -UserPrincipalName renamed@example.com –NewUserPrincipalName renamed@example.com

After the UPN was modified the attributes “Identity” and “Name” needs to be modified from Exchange online servers using the command below:


Set-Mailbox renamed@example.com -Name renamed@example.com 
 
Set-Mailbox renamed@example.com -WindowsEmailAddress renamed@example.com


 To verify the all the important attributes were modified run the command below:

Get-Mailbox renamed@example.com |FL WindowsLiveID, MicrosoftOnlineServicesID, Identity, Name, WindowsEmailAddress, PrimarySmtpAddress, EmailAddresses, UserPrincipalName

Reusing a user ID If you rename a user's user ID and plan to use the old user ID value for a different user's mailbox, be aware of the following issues:


 You must manually remove the old user ID value from the proxy addresses of the existing user's mailbox. This will prevent the existing user from receiving any messages sent to the old user ID.


 

Rename a Windows Live ID:

http://help.outlook.com/en-au/140/ee423637.aspx