Automatically add email alias to user / forward email alias to user

8,159

Solution 1

You should be able create a Email Address Policy in O365 using the *-EmailAddressPolicy (new, get, set, remove etc.) This will allow you to define how email addresses are assigned to users that have this policy enabled.

The technet article shows that it is supported in Exchange Online. https://technet.microsoft.com/en-us/library/aa996800(v=exchg.160).aspx

Here's more info about Email Address Policies. https://technet.microsoft.com/en-us/library/bb232171(v=exchg.160).aspx

I would recommend looking at your default policy and potentially adjusting that. Get-EmailAddressPolicy | Format-List should show you all the values of the default policy. You're probably most concerned about "EnabledEmailAddressTemplates"

You can edit this to do what you want it to, IE: set-EmailAddressPolicy "Default Policy" -EnabledEmailAddressTemplates "SMTP:@maindomain.com","smtp:@newdomain.com"

Note a couple things: There can only be ONE "SMTP", thats the reply to address You can have as many lowercase "smtp" aliases as you want, assuming the domains are set.

This wont be enabled by default, you will need to flip the "EmailAddressPolicyEnabled" from $false to $true on the mailbox for it to take affect. Also note, if you do this on an existing user, it will honor the policy, so make sure you have tested it!!

Solution 2

Adding New Email Addresses for Multiple Mailbox Users by Paul Cunningham pretty much covers this subject.

Here’s a summary of the approaches you can use:

  • For on-premises and Hybrid organizations, bulk email address changes (whether to all users or just a subset of users) can be managed with email address policies. You can also manually modify email addresses for individual recipients, or for multiple recipients using PowerShell.

  • For cloud-only Office 365 organizations, bulk email address changes can be made when adding a new domain to your tenant, or at any time you can bulk add SMTP addresses to multiple mailboxes using PowerShell.

Share:
8,159

Related videos on Youtube

Gavin
Author by

Gavin

Web / mobile / application developer. My favourite pet projects at present are: NZ Topo Map NZ Topo Map app for Windows Phone

Updated on September 18, 2022

Comments

  • Gavin
    Gavin over 1 year

    In Office 365 we've added a domain alias which we'd like to automatically add user email aliases for. I understand we can script this task to add the email domain alias to all existing users, but it would be preferred to automatically assign a email domain alias to all new users on creation to prevent someone forgetting to do this in future. Is this possible?

    Alternatively, is it possible to set up some Exchange Admin Center rule that would automatically forward an email domain alias to the primary domain equivalent, thus removing the need for email aliases on each user account?

  • Gavin
    Gavin almost 7 years
    So it looks like there isn't a solution to add aliases automatically for new users that are created in Office 365 (we're cloud only). Only option is to run PowerShell script manually every now and then to fill any gaps for now.
  • realMarkusSchmidt
    realMarkusSchmidt over 4 years
    Yes, it's available for Exchange Online, but, as the linked Microsoft Docs say: "In Exchange Online, email address policies are only available for Office 365 groups." So, for cloud-only setups, it's pretty much useless, sadly.