question

Sop-3080 avatar image
0 Votes"
Sop-3080 asked KyleXu-MSFT commented

Email Address policy

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

office-exchange-server-administrationwindows-active-directoryoffice-exchange-online-itprooffice-exchange-server-itpro
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KyleXu-MSFT avatar image
0 Votes"
KyleXu-MSFT answered KyleXu-MSFT commented

@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.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Safs-3080

I am writing here to confirm with you any update about this thread now?
If the above suggestion helps, please be free to mark it as an answer for helping more people.

0 Votes 0 ·