Remove all smtp address except default

Hello,

Is it possible to remove all smtp addresses except default one for all user with powershell?

June 30th, 2015 12:48pm

Yup, it's easy enough:

Get-Mailbox | % {Set-Mailbox $_.Identity -EmailAddresses $_.PrimarySMTPAddress}

Just a note - this will also strip any SIP addresses, X400/X500 and whatnot. So use with care, and make sure you test first.

Free Windows Admin Tool Kit Click here and download it now
June 30th, 2015 3:27pm

Hi,

Please refer to the following steps:

1. Set the email address policy to false.

Get-mailbox resultsize unlimited | Set-mailbox EmailAddressPolicy $false

2. Set the email address for mailboxes according to email address policy, by default the email address policy use the format of Alias+domain.com. This script will remove all other SMTP addresses.

Get-Mailbox ResultSize Unlimited | % {Set-mailbox identity $_.Identity EmailAddresses ($_.Alias + @domain.com)}

3. Then enable the email address policy.

Get-mailbox resultsize unlimited | Set-mailbox EmailAddressPolicy $true

Check with this command.

Get-mailbox | fl EmailAddresses

Note: Change the domain.com to your company.

Best Regards.

July 1st, 2015 3:06am

Hi,

Please refer to the following steps:

1. Set the email address policy to false.

Get-mailbox resultsize unlimited | Set-mailbox EmailAddressPolicy $false

2. Set the email address for mailboxes according to email address policy, by default the email address policy use the format of Alias+domain.com. This script will remove all other SMTP addresses.

Get-Mailbox ResultSize Unlimited | % {Set-mailbox identity $_.Identity EmailAddresses ($_.Alias + @domain.com)}

3. Then enable the email address policy.

Get-mailbox resultsize unlimited | Set-mailbox EmailAddressPolicy $true

Check with this command.

Get-mailbox | fl EmailAddresses

Note: Change the domain.com to your company.

Best Re

Free Windows Admin Tool Kit Click here and download it now
July 1st, 2015 5:52am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics