The proxy address is already being used by the proxy address of another mailbox

Or, why can’t I remove the alias or proxy address from a Shared Mailbox?

We’re setting up an Office 365 tenant for a customer with multiple domains. Each domain has a few Shared Mailboxes for things like info@ and accounts@. We ran into a problem when adding the Shared Mailboxes for each of these domains via the Exchange Admin Center.

The message reads:

The Proxy Address Error

The proxy address “SMTP:accounts@seconddomain.com” is already being used by the proxy addresses or LegacyExchangeDN of “Accounts – First Domain”. Please choose another proxy address. (The “UserMaiIbox” with display name “Accounts -First Domain” is already setup and using the same address.)

This issue was occurring because the first Shared Mailbox we created was being assigned a UserPrincipalName on the default domain of the organisation (seconddomain.com in this example). This was happening even though the Primary SMTP Address of the Shared Mailbox was set to be a different domain.

When we’d attempt to add another Shared Mailbox using the default domain, we’d get the error that the address was already added to an existing mailbox.

When we’d attempt to remove the email address from the other mailbox via the Exchange Admin Center, it would keep coming back.

How do you remove the proxy address from the other mailbox?

To resolve this, I connected to Azure Active Directory and Exchange Online via Powershell.

I first ran the following cmdlet to get all the properties of the mailbox to see where it was going wrong:

Get-mailbox accounts@firstdomain.com | fl *

Here’s a cmdlet you can run that will just return the two relevant values:

Get-Mailbox accounts@firstdomain.com | fl UserPrincipalName,EmailAddresses

UserPrincipalName And EmailAddresses Are Wrong

Here we can see that the primary SMTP address (the one preceded by SMTP) is correct, though the UserPrincipalName is not. There’s also an alias or proxy address that was created using the default domain (seconddomain.com in this case).

The problem is that it’s not easy to remove the other address from the EmailAddresses list. Even when attempted via the Exchange Admin Center, the email address appears to disappear though reappears each time we reopen the properties to view the email addresses.

I thought that I could just switch back to PowerShell and run set-mailbox accounts@firstdomain.com -EmailAddresses SMTP:accounts@firstdomain.com to remove the extra proxy address. Though it still wouldn’t go.

Removing the proxy/alias address via PowerShell

To resolve this, I had to change the UserPrincipalName of the mailbox first, and then remove the proxy address.

Since we can’t change the UserPrincipalName value via Exchange Online, we need to connect to Azure Active Directory.

To connect to Azure Active Directory, you’ll need to install the Azure Active Directory PowerShell module. Follow our quick guide here to get this setup. Once it’s installed, you can run the following using an Office 365 admin account:

Connect-MsolService

To change the UserPrincipalName we use the Set-MsolUserPrincipalName cmdlet:

Set-MsolUserPrincipalName -UserPrincipalName accounts@seconddomain.com -NewUserPrincipalName accounts@firstdomain.com

Changing UserPrincipalName To Correct Domain

Give it a minute, then rerun the Get-Mailbox cmdlet. You’ll see that that the UserPrincipalName is now correct.

Get-Mailbox accounts@firstdomain.com | fl UserPrincipalName,EmailAddresses

UserPrincipalName Is Correct EmailAddresses Still Need Changing

Now that the UserPrincipalName has changed, we can retry the Set-Mailbox cmdlet followed by that same Get-Mailbox cmdlet:

Set-Mailbox accounts@firstdomain.com -EmailAddresses SMTP:accounts@firstdomain.com
Get-Mailbox accounts@firstdomain.com | fl UserPrincipalName,EmailAddresses

Removing The Extra Proxy Address And Confirming That It Worked

It now works. The unwanted proxy address has been removed, and it can now be added to its own Shared Mailbox.

The entire Office 365 alias/proxy address removal process

  1. Make sure you can connect to Azure Active Directory (you’ll need to install the Azure Active Directory Module. See our quick guide here)
  2. Open PowerShell and connect to Exchange Online (follow our quick guide here for instructions)
  3. Run the following cmdlet to connect to Azure Active Directory:
    Connect-MsolService
  4. Confirm the details of the mailbox that you can’t remove the proxy address from:
    Get-Mailbox accounts@firstdomain.com | fl UserPrincipalName,EmailAddresses
  5. Change the UserPrincipalName using Set-MsolUserPrincipalName:
    Set-MsolUserPrincipalName -UserPrincipalName accounts@seconddomain.com -NewUserPrincipalName accounts@firstdomain.com
  6. Wait a minute and remove the unwanted proxy address using Set-Mailbox
    Set-Mailbox accounts@firstdomain.com -EmailAddresses SMTP:accounts@firstdomain.com
  7. Confirm that the ProxyAddress is gone using Get-Mailbox
    Get-Mailbox accounts@firstdomain.com | fl UserPrincipalName,EmailAddresses

Some Troubleshooting

You receive an Access Denied Error after retrying set-msoluserprincipalName

Troubleshooting Access Denied Error

Note that the Set-MsolUserPrincipalName cmdlet can take a minute to process. If you try to run get-mailbox soon after changing it, it may still reflect the old name. If you try running Set-MsolUserPrincipalName again, you might get an error that reads:

Access Denied. You do not have permissions to call this cmdlet.

Just give it a minute or so, and run the get-mailbox cmdlet again, you should see that the UserPrincipalName value is updated.

Want to change the default domain for your tenant?

If you want to change the default domain for your Office 365 organisation you can do this via the Office 365 Admin Portal, or via Powershell.

To do it via PowerShell run the following cmdlet for the domain that you’d like to have as the default:

Set-MsolDomain -Name rightdomain.com -IsDefault

You can also run the following cmdlet to confirm that it worked:

Get-MsolDomain -DomainName rightdomain.com | fl *

Was this article helpful?

Related Articles