Remove SMTP address for a specific domain from all mailboxes.

Here is a handy script to remove obsolete proxyaddresses from all mailboxes.

foreach($i
in Get-Mailbox
-ResultSize Unlimited)
{
  $i.EmailAddresses |
    ?{$_.AddressString
-like ‘*@domain.com’}
| %{
      Set-Mailbox $i -EmailAddresses @{remove=$_}
    }

}
Just replace the domain.com with your own. 
Author: Harri Jaakkonen

Leave a Reply

Your email address will not be published. Required fields are marked *