How to Add Additional SMTP proxy address to multiple users

Jacob DurhamNetwork and System Admin
CERTIFIED EXPERT
Systems Administrator
Published:
Updated:
Edited by: Andrew Leniart
A quick guide on adding multiple SMTP proxy addresses to Users for Office 365

Email addresses are a constantly changing constraint for countless administrations, principally when mergers, acquisitions, or re-branding movements are underway. Unsurprisingly, this is something that falls on the Exchange manager to resolve. There's an assortment of situations that could be put in front of you, depending on whether it is all or just some of the users in the organization that need an email address change. 


My organization recently migrated to Office 365 and lost some of the SMTP proxy addresses in the move. We use these addresses with multiple different services to route notifications. In this instance, we are routing our voicemail to email. A mailbox can have multiple different addresses in which it receives mail.


I needed to create a new email alias with the users sAMAccountName property attached to our new domain.


This had to be done in our on-premises Active Directory and then synced to Azure AD.


Using the code shown below, I was able to automate that process.


In order for this to work, you’ll need to have the new domain verified and set up in Office 365.


Here’s how to do it:


  1. Open Powershell on your domain controller.

  2. Modify and run the following script to create a new secondary SMTP address for all active users in your domain.


foreach (
                    $user in 
                        (get-aduser -filter 'enabled -eq $true')
               ) 
{$newsmtp = "$($user.samaccountname)@yourdomain.com"  
set-aduser $user.samaccountname -Add @{Proxyaddresses="smtp:$newsmtp"} -verbose}


    3. You’re done. You can run the following command to confirm that it worked:


get-aduser -filter 'enabled -eq $true'  -properties * | Select-object proxyaddressess -ExpandProperty proxyaddresses

This creates a new SMTP proxy address for every active user in the domain. After creating the aliases, Office 365 takes about 24 hours to allow delivery to those addresses.


I hope this article helps you implement a similar solution in your environment.



0
3,655 Views
Jacob DurhamNetwork and System Admin
CERTIFIED EXPERT
Systems Administrator

Comments (0)

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.