Adding Default Aliases for All Users in Office 365

We have multiple domains within a cloud tenant of Office 365 but only one domain is used by default. I'm trying to find a way to automatically add aliases for each domain with a user's main email. So for example if someone is bob.smith@domain1.com we automatically add bob.smith@domain2.com and bob.smith@domain3.com

It looks like there's a way to do this via power shell but all the documentation I found seems to be conflicting if this is possible and if it's possible via a cloud tenant and not just for on-premise.

Ideally we'd be able to apply this to all existing users and then have this default for future users.

Does anyone have experience doing something like this?
 

Staubo

Ars Scholae Palatinae
991
Subscriptor++
Are you doing this via on-prem AD that is then sync'd to the cloud, or is your M365 instance independent? Most M365/on-prem AD environments have AD be the trusted source, then use dirsync to push accounts to Azure AD/"Entra". If this is your account creation process, you need to use PowerShell against any newly created account in AD and add your email aliases via the ProxyAddress field. You cannot edit user accounts in both AD and Azure AD. Only one can be the trusted source.

Exchange takes the ProxyAddress values to determine primary email address and any aliases by using "SMTP:" all caps to set primary and lower case "smtp:" for aliases. (this applies for both legacy Exchange servers and Exchange Online)

Set-ADUser "user" -Add @{ProxyAddresses=(smtp:Email@domain2.com),(smtp:Email@domain3.com),(smtp:Email@domain4.com)}