Edit Shared Mailbox SMTP Address with Powershell

Connect yourself to Exchange 2013. In this demo, I’m using office 365.

$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session

Once connected to Exchange 2013 and all of the modules have been imported, run:

Get-Mailbox -Identity xxx@domain.com

This will display tons of information about the shared mailbox. To shorten the information down to what I wanted, I ran:

Get-Mailbox -Identity xxx@domain.com | Format-List EmailAddresses

Make sure you utilize “EmailAddresses” property, not EmailAddress.

This will show you the SMTP information, and the line will look similar to:

EmailAddresses: {SMTP:xxx@domain.com, smtp: xxx@domain.onmicrosoft.com}

Now that you know what the SMTP (since it’s capital, it’s the primary address) you need to change it. Run the following command:

Set-Mailbox -Identity xxx@domain.com -EmailAddresses xxxNew@domain.com

Pretty simple. When you run the “Get-Mailbox” command again, you will see this:

EmailAddresses: {SMTP:xxxNew@domain.com, smtp: xxx@domain.onmicrosoft.com}

Now, if you send email the xxx@domain.com, it will bounce back, if you send it to xxxNew@domain.com the mail will be received in the shared mailbox.

** If you’re trying to change an email address that is part of your synchronized Active Directory, this will fail. You MUST change the SMTP setting through your Active Directory.



One thought on “Edit Shared Mailbox SMTP Address with Powershell

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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