Email Address policy

Sophia 356 Reputation points
2021-04-29T19:24:05.227+00:00

So, I would greatly appreciate if anyone could help me find out what new email address has been added to list mailboxes due to an email address policy.

We had a default policy that was applied to most mailboxes and we created a "Test" Email Address policy with Primary SMTP address which mistakenly was applied to everyone(Due to its priority being higher). We have since deleted the policy but now every mailbox now has this added smtp address.

Is there a way for me to see what mailboxes didn't have this newly added smtp address before?

Thanks

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
5,852 questions
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,175 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,349 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. KyleXu-MSFT 26,211 Reputation points
    2021-04-30T02:01:03.917+00:00

    @Safs-3080

    Try to apply another email address policy on all mailboxes to change the primary smtp address fist(Because, we cannot remove a primary smtp address directly), then we can use script below to delete them:

    $Mailboxes = Get-Mailbox | where {$_.EmailAddresses -like "*domain.com*"}  
      
    foreach($Mailbox in $Mailboxes){    
          
        $temp = $Mailbox.Name  
        $temp2 = ((Get-Mailbox $temp).EmailAddresses -like "*@domain.com") -replace "\w*\:"  
      
        Set-Mailbox $temp -EmailAddresses @{remove=$temp2}  
    }  
    

    Change those two places before running:

    1. Don't remove "*" from this script
    2. The fist place don't have "@"

    92739-qa-kyle-09-58-35.png


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.