Wednesday, May 22, 2013

How to Change a Users Primary Email Address in Office 365

Microsoft's Office 365 is still pretty new and some things that seem like they should be easy and obvious are not. While Office 365 administrative interface for Exchange may seem limited, virtually everything that can be done in Exchange can be done in Office 365, it's just that some functions may require Windows PowerShell.

If you haven't already setup Windows PowerShell to work with Office 365, please see: How to Install and Configure PowerShell for Office 365 in Windows 8.

Keep in mind, I've cleared the PowerShell windows after each command for clarity. Yours, if left uncleared, will scroll when the window becomes full.

Run the Windows Azure Active Directory Module for Windows PowerShell as administrator

To run the scripts needed to change a user’s primary email address we must first set the script execution policy. At the PowerShell prompt type the following cmdlet (PowerShell command):


The execution policy needs to be RemoteSigned. RemoteSigned allows only downloaded scripts signed by a trusted publisher to be run. If Get-ExecutionPolicy doesn't return RemoteSigned, it must be changed by typing the following cmdlet and entering a "y" when prompted:

Set-ExecutionPolicy RemoteSigned

Now Get-ExecutionPolicy returns RemoteSigned

Next we need to provide Office 365 with administrative credentials to be able to make changes. We're going to assign our credentials to the variable $MSCred...

$MSCred = Get-Credential

...and PowerShell prompts for an Office 365 account with administrative permissions.

After entering the credentials of a Office 365 administrator account and clicking OK, we need to open a connection to the Office 365 servers. The following command opens a connection, passes on our credentials, and assigns the variable $Session to our session.

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $MSCred -Authentication Basic -AllowRedirection

Once the connection is open we need to import the commands for the Exchange Server shell.

Import-PSSession $Session

At this point we are ready to issue commands to Office 365. The following command sets a user's primary email address from the current address to the desired address without changing the username. Replace and to the appropriate email addresses:

Set-Mailbox -identity -WindowsEmailAddress

The Office 365 online administrative interface should show the new email address as the primary.

Last we should close the session. If we do not close the session, it will remain available until it times out.

Remove-PSSession $Session

More Exchange cmdlets can be found at


  1. Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. email address

  2. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.

  3. Precisely, you're exceptionally sort of us about remark!. Hotmail email

  4. Love how wonderfully every word is written with proper balance.
    DuoCircle - Anti-Phishing

  5. Thanks for this post, very useful! Check out — Chrome extension that reveals personal contacts from social networks.candidate contact information

  6. Email List USA Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome!

  7. I have read all the comments and suggestions posted by the visitors for this article are very fine,We will wait for your next article so only.Thanks!

  8. i have read all the comments , waiting for new article . Thanks

  9. I was surfing the Internet for information and came across your blog. I am impressed by the information you have on this blog. It shows how well you understand this subject. visite este site

  10. Most of the time I don’t make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post!
    business email

  11. I'm glad I found this web site, I couldn't find any knowledge on this matter prior to.Also operate a site and if you are ever interested in doing some visitor writing for me if possible feel free to let me know, im always look for people to check out my web site. email finder

  12. Your post give me lots of advise it is very useful for me. I want to introduce for you about the game. in this game, you can create character and operate as same as in the real world. Click link to participate games. sims 4 cheats

  13. What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much. hotmail login

  14. Thanks for the information ymail. Its fantastic

  15. 3 easy ways to better implement remote working and reap its benefits. Improvement in technological infrastructure, redefining policies to suit your employees better org chart templates