<

How to Add Additional SMTP proxy address to multiple users

Published on
3,202 Points
202 Views
Last Modified:
Editors:
Jacob Durham
Systems Administrator
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
0 Comments

Featured Post

Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month