Hello,
Is it possible to remove all smtp addresses except default one for all user with powershell?
Technology Tips and News
Hello,
Is it possible to remove all smtp addresses except default one for all user with powershell?
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.
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.
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