Summary

Add multiple SMTP proxy addresses to contact objects in office 365. Assuming cloud governance defines managing objects through the public cloud portal.

The Problem

The Office 365 admin panel is limited in only allowing the admin to add a single email address to a mail contact. If you want to add multiple addresses, you have to use PowerShell.

Steps: Add Multiple Email Addresses to Mail Contacts

Use the following set of commands to add and verify the additional proxy addresses.

  1. To connect PowerShell to Office 365, open the PowerShell console
  2. Type the following command: $Cred = Get-Credential
  3. Enter the username / password of a valid O365 admin account
  4. Type the following command: $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic –AllowRedirection
  5. Type the following command: Import-PSSession $Session
  6. Powershell is now attached to Office 365 Exchange and we can run the command to add addresses to the mail contact. Note that the primary address should have uppercase “SMTP:” prepended (there can be only one uppercase entry for the primary address. Additional secondary addresses must have lowercase otherwise there will be mail flow problems.)
  7. Set-MailContact “User Name” -EmailAddresses “SMTP:primary.email@domain.com”,”smtp:secondary.email@domain.com”

 
Code

$Cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic –AllowRedirection
Import-PSSession $Session
Set-MailContact “User Name” -EmailAddresses "SMTP:primary.email@domain.com","smtp:secondary.email@domain.com"

 
Confirmation
To confirm this has worked run the following command:

  1. Get-MailContact “User Name” | select -ExpandProperty EmailAddresses
  2. Check the admin web interface and check the external email address is correct. This is the address receiving all incoming email for the contact.

References

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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