Add multiple SMTP proxy addresses to contact objects in office 365. Assuming cloud governance defines managing objects through the public cloud portal.
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.
- To connect PowerShell to Office 365, open the PowerShell console
- Type the following command: $Cred = Get-Credential
- Enter the username / password of a valid O365 admin account
- Type the following command: $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic –AllowRedirection
- Type the following command: Import-PSSession $Session
- 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.)
- Set-MailContact “User Name” -EmailAddresses “SMTP:email@example.com”,”smtp:firstname.lastname@example.org”
$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:email@example.com","smtp:firstname.lastname@example.org"
To confirm this has worked run the following command:
- Get-MailContact “User Name” | select -ExpandProperty EmailAddresses
- Check the admin web interface and check the external email address is correct. This is the address receiving all incoming email for the contact.