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. I know this is one of the most meaningful information for me. And I'm animated reading your article. But should remark on some general things, the website style is perfect; the articles are great. Thanks for the ton of tangible and attainable help. Hotmail é um serviço de webmail gratuito

  5. Hi I am Divya Goal I know Over Post is very nice ... Thank You For sharing Divya Bangalore Escorts

  6. Ludhiana escorts are educated along with experienced and they Have the propensity to catch the attention of consumers with their sex appeal and glorious bodily structure. That's to say they might be called intriguing, sexy, and alluring.
    Ludhiana escorts
    Dehradun Escorts
    Jodhpur escorts
    Gurgaon Escorts
    Noida Escorts
    Chandigarh Escorts

  7. Ludhiana escorts are educated along with experienced and they Have the propensity to catch the attention of consumers with their sex appeal and glorious bodily structure. That's to say they might be called intriguing, sexy, and alluring.
    Ludhiana Call Girls
    Dehradun Call Girls
    Jodhpur Call Girls
    Gurgaon Call Girls
    Noida Call Girls
    Chandigarh Call Girls

  8. The entirety of our young Dehradun call girls photographs are 100% certifiable so when you will meet her, she will be not let down you at all. On the off chance that you have to go out with her, our escorts amazingly familiar with Dehradun escorts are where anyone needs to join, a few people came here for their work, some for entertainment only and some came getting erotic with escorts in Dehradun.
    Dehradun escort service
    Haridwar escort service
    Mussoorie escort service
    Rishikesh escort service
    haldwani escort service
    Nainital escort service
    Ramnagar escort service
    Rudrapur escort service

  9. Thanks for an interesting blog. What else may I get that sort of info written in such a perfect approach? I have an undertaking that I am just now operating on, and I have been on the lookout for such info. gmail bulk mail sender

  10. The information you are providing that is really good. Thank for making and spending your precious time for this useful information. Thanks again and keep it up. Top CA firm in India

  11. It's crazy how they put this much thought in to determining a brand name! What is even crazier is its short-term and long-term benefits in your business! CBT Email Extractor