Company News

Changing the primary email address of an Office Group in 365

February 7, 2017

What

Renaming an Office 365 Group is simple if all you want to change is its display name. However, if you want to free up the email address it used (in our case, Office 365 Groups are neat and all, but the mailbox functionality is extremely limited – you can’t move messages, archive them, categorize them … truly almost completely useless).

So What

Again, renaming the Group is easy in the Admin Web Pages of Office 365. But if you need to rename the email address/alias it uses, you’ll need some PowerShell and hit up:

  •  The Primary Address (primarySMTPAddress)
  • The Email Aliases it uses (emailaddresses)

Now What

I’m not going to go into all the detail of how to connect and authenticate to Exchange Online as there is lots of stuff out there, I’m just going to point out what you’ll want to be changing and checking…

 

To Check Where The Email Alias (Proxy) is right now…

Let’s assume for this exercise that beers@company.com was pointed to an Outlook Group and you decided that using a group wasn’t a fit (such as the example above) and instead that you wanted to reclaim that alias for a Shared Mailbox (in our case, we couldn’t just delete the old group as it had stuff we wanted to keep in it).

Get-Recipient | where {$_.EmailAddresses -match “beers@company.com”} | fL Name, RecipientType,emailaddresses

To Change the Group (called “Our Beers”) Primary Address to “WasBeers@company.com”

Set-UnifiedGroup -Identity “Our Beers” -PrimarySmtpAddress “wasbeers@company.com”

To Change the Group (called “Our Beers”) Alias to “WasBeers@company.com”

Set-UnifiedGroup -Identity “Our Beers” -alias “wasbeers@company.com”

To Remove “Beers@company.com” from the Group as a proxy/alias

set-unifiedgroup “Our Beers” -emailaddresses @{remove=”beers@company.com”}

7 Responses

  1. Bryan Antepara says:

    What about changing the domain names for ALL of the groups at the same time?

  2. Matthew Prentice says:

    The proxy address still exists in at least one more place and it appears Microsoft does not provide a way to delete it. If you use the Azure AD v2 PowerShell module, run Get-AzureAdGroup to see the list of groups. Then run the cmdlet again with the -ObjectID for the specific group and pipe to “fl proxyaddresses”. The alias will still be listed.

    The Set-AzureAdGroup cmdlet does not allow modifying ProxyAddresses and so far Microsoft has not figured out a way to delete the address.

    We are trying to remove a vanity domain from the tenant that has Power BI so we can add it to a new tenant. We are not willing to delete the O365 Groups as they may adversely affect the Power BI workspaces and reporting. We can’t delete the domain from the tenant until we remove the aliases from the O365 Groups.

    • Ian Moran says:

      Hi Matthew,

      Exact same situation here. Were you able to progress this ? We have 43 Office 365 groups in our tenant and we wish to remove the accepted domain but removal is blocking as the domain is still associated with the groups in question.

      • Toby says:

        I see the same thing. I can use Set-UnifiedGroup to set the PrimarySmtpAddress and the EmailAddresses. And this does seem to affect what email addresses email can be delivered to. However, when a O365 Group is created, it also creates a MsolGroup, and if you run a Get-MsolGroup for the group, you will see that the ProxyAddresses attribute was not affected at all, and still has the same 2 addresses listed, and these are the 2 addresses that are still listed in the UI as well. I find no way to change them, and it still means you cannot set (or sync from AD) any other MsolUser or MsolGroup with that address in their ProxyAddresses attribute without a conflict. Come on Microsoft, get your act together. These O365 Groups are still buggy and hard to control. I might be able to delete and re-add the group to free up the email address, but that loses all current email/files/etc. in the O365 group!

        • William Rizk says:

          Hi All,

          I have found a way around this. Change all primary SMTP addresses of the Office 365 groups to primary domain or the domain you don’t want delete. Delete all the office 365 groups that contain the proxy address of the domain you want to remove, delete the domain once all groups have been removed, restore the groups after the domain deletion in office 365. I tested this and all is working.

          Import-Module AzureADPreview
          Connect-AzureAD
          Get-UnifiedGroup -Identity | Remove-UnifiedGroup

          To Restore:
          Get-AzureADMSDeletedGroup
          Restore-AzureADMSDeletedDirectoryObject –Id

          If you have a huge list to restore, run
          Get-AzureADMSDeletedGroup | Restore-AzureADMSDeletedDirectoryObject

  3. Thank you. This post saved my sanity, trying to change a Group email address in an emergency too late one evening. Much appreciated, MVP.

  4. Graham says:

    After creating a group, how much time do you typically have to wait when changing the primarySMTP address for the group?

Leave a Reply

Sean Wallbridge

Sean Wallbridge-square-150x150

Beer Me!

Subscribe via Email

Categories

Powered by...

itgroove Corporate Profile
Connect With Us