I can't clear an SMTP address off a few accounts.

Root777 26 Reputation points
2024-08-20T16:35:46.0666667+00:00

Background, we migrated our tenant from O365 retail to O365 GCC about 2 years ago. The previous tenant was company.mail.onmicrosoft.com and the new gcc tenant domain was companyinc.mail.onmicrosoft.com.

We're migrating the mailboxes and all but 4 we're successful.

Error: NotAcceptedDomainException: You can't use the domain company.mail.onmicrosoft.com because it's not an accepted domain for your organization.

Should be a simple fix. Remove the SMTP address and resync.

Removing the SMTP address from EAC I'm able to click the minus to delete and the domain, click save and the page closes. Reopen the properties page for that user and the address is still there.

Attempt #2..Exchange Mgmt Shell

Set-Mailbox "Purchasing" -EmailAddresses @{remove="smtp:purchasing@company.mail.onmicrosoft.com"}

Command seems to run successfully however running "get-mailbox -Identity purchasing | Format-List *" shows the SMTP address is still there.

As an alternate, Microsoft recommends setting the smtp address and omitting the unwanted address.

https://learn.microsoft.com/en-us/exchange/recipients/user-mailboxes/email-addresses?view=exchserver-2016

Again, the command seems to run successfully but the SMTP address remains on the mailbox.

Interestingly. I attempted to edit the SMTP address purchasing1@companyinc.mail.onmicrosoft.com. It just adds an SMTP address, leaving the original untouched. I can also delete the newly created record without issue.

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,519 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,626 questions
{count} votes

Accepted answer
  1. Xintao Qiao-MSFT 3,285 Reputation points Microsoft Vendor
    2024-08-21T01:44:23.82+00:00

    Hi, @Root777

    Great to know that the issue has already been resolved and thanks for sharing the solution so that others experiencing the same thing can easily reference this!

    Since the Microsoft Q&A community has a policy that "[The question author cannot accept their own answer. They can only accept answers by others Accept answers on Microsoft Q&A | Microsoft Learn]", I'll repost your solution in case you'd like to "[Accept ]" the answer : )  Accept answers on Microsoft Q&A | Microsoft Learn   

    --------------   

    Issue Symptom: 

    Fail to clear an SMTP address of a few accounts.

    Error: NotAcceptedDomainException: You can't use the domain because it's not an accepted domain for your organization.

    Resolution: 

    Modify the Email Address Policy under mail flow in EAC.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Root777 26 Reputation points
    2024-08-20T16:50:06.99+00:00

    Well if you've found yourself in my shoes the answer was to modify the Email Address Policy under Mailflow in EAC.

    I removed the alias@company.mail.onmicrosoft.com from the policy and I'm able to delete the unwanted SMTP record.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.