Removing X400 Addresses from Recipients

If you Exchange environment has been through a number of upgrades you may find, with Exchange 2013, you want to clean up unneeded addresses.

The following PowerShell example can assist with this. The code below gets a list of Mailboxes that contain X400 addresses, then creates a new set of email addresses for each recipient, sans X400 address. The new set of email addresses is then applied to the mailbox.

$Recipients = Get-Mailbox -ResultSize Unlimited | Where {$_.EmailAddresses -like “X400:*”}
foreach ($Recipient in $Recipients)
[array]$AllEmailAddresses = $Recipient.EmailAddresses
[array]$NoX400Addresses = $Recipient.EmailAddresses | Where {$_ -notlike “X400:*”}
Set-Mailbox -Identity $Recipient.Identity -EmailAddresses $NoX400Addresses

You can alter the script to alter other recipient types, such as MailContacts, DistributionGroups and MailPublicFolders. Simply replace Get-Mailbox and Set-Mailbox with the appropriate command.

About The Author

3 thoughts on “Removing X400 Addresses from Recipients”

    1. HI Mujaffar,
      Keep two columns; emailID, X400 in SV file

      Import-Csv C:\users.csv | % {
      Set-Mailbox $_.emailID -EmailAddresses @{remove=$_.X400}

      Please let me know if you need any further details.

Leave a Comment

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top