If I understand correctly, you just need to change the template:
Set-EmailAddressPolicy "bla bla" -EnabledPrimarySMTPAddressTemplate "SMTP:%g.%i.%s@contoso.com"
You can find all the variables here: https://technet.microsoft.com/en-us/library/bb232171(v=exchg.150).aspx
- Proposed as answer by Lynn-LiMicrosoft contingent staff, Moderator 22 minutes ago
Thank you for your response. One thing that I have to make sure is that the primary SMTP:Alias@contoso.com doesn't change because it will break access for users on certain systems and applications. Will this set of cmdlets only add the address "SMTP:%g.%i.%s@contoso.com" to the Default Policy we are currently using? I'm sorry I'm really bad when it comes to cmd line
Set-EmailAddressPolicy "Default Policy" -EnabledPrimarySMTPAddressTemplate "SMTP:%g.%i.%s@contoso.com"
Hi,
If you just want to add the address "SMTP:%g.%i.%s@contoso.com" to the Default Policy and dont want to break the primary SMTP Email Address, please take the following steps:
- Navigate to Mail flow > Email address policies, double-click to Default Policy.
- Under email address format tab, click Add button.
- Click more options to enter a custom address type.
- In the first field, enter SMTP.
- In the second field, enter %g.%i.%s@contoso.com
- Click save to save this change.
- Click Apply link to update this policy on the right pane of Email Address list.
You can check this change by the following steps:
- Choose one user and double-click to properties.
- Under email address tab, you will find that the list contains the primary SMTP Email Address and the custom address type we created just now.
Best Regards.