Forum Discussion
malone81
Nov 04, 2020Copper Contributor
Adding email alias in Exchange Online no longer works and throws out the below error
Hi, I had to disable AAD Connect recently and when I got everything back up and running, I received the below error when adding and alias and this is happening for every account I have tried. ...
VasilMichev
Nov 04, 2020MVP
If you have dirsync enabled, you cannot make such changes directly in ExO. Your on-premises AD is the "master" and O365 admin interfaces will always throw a similar error.
The only workaround for this scenario is to use the -WindowsEmailAddress parameter:
Set-Mailbox user@domain.com -WindowsEmailAddress new@domain.com
which will set new@domain.com as the new primary SMTP address, while keeping the old one as secondary. This still does not guarantee that the change will not be overwritten during the next full sync cycle, moreover it's not an officially supported mehtod.
- cameronshoveJan 20, 2023Copper Contributor
VasilMichev from where do you run this command? I tried to do so from O365 cloud PowerShell but the Get-Mailbox command is unknown, even after running: Install-Module MSOnline
and Import-Module MSOnline. Thank you- DeletedJan 29, 2023
cameronshove
To run get-mailbox or set-mailbox, you need to be connected to the exchange online PowerShell module. The one you were connected to is for MSOL service.Use the commands below. A sample is also shown in the attached screenshot.
- Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
- Type in A (Yes to All) on the next line and hit the enter key.
- Install-module exchangeonlinemanagement -Scope CurrentUser -Force
- import-module exchangeonlinemanagement
- connect-exchangeonline (this will pop-up a window to authenticate with your admin account)
Once you authenticate with the admin account, you will be able to run the CMDLETS under exchange online. However, some EXO commands requires additional permission to be assigned to the account that is being used.
- Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
- malone81Nov 04, 2020Copper Contributor