Remove Domain Suffix for All Users

Tested on Exchange 2010

To remove a specific domain suffix for all users, use the following PS1

# Get all mailboxes
$mailboxes = get-mailbox;

# Loop through each mailbox
foreach ($mailbox in $mailboxes) {

$emailaddresses = $mailbox.emailaddresses;

#Loop through each SMTP address found on each mailbox
for ($i=0; $i -lt $emailaddresses.count; $i++) {

# Change the domain name below to what you want to remove
if ($emailaddresses[$i].smtpaddress -like “**”) {

# Remove the unwanted email address
$badaddress = $emailaddresses[$i];
$emailaddresses = $emailaddresses – $badaddress;
$mailbox | set-mailbox -emailaddresses $emailaddresses;





Categories: Microsoft, Office 365 | Leave a comment

Post navigation

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at

%d bloggers like this: