01-09-2019 07:58 PM
01-09-2019 07:58 PM
I am trying to set the PrimarySMTPAddress using PowerShell in exchange online for a few different users. I realize that when connecting to office 365 powershell directly, i can use the set-mailbox command and the -EmailAddresses field.
However in in Exchange On-Prem (DirSync'd to Office 365), i tried running running set-remotemailbox -primarysmtpaddress, the command ran fine and the address was changed but only for the on premise "Object".
How do i change the PrimarySMTPAddress for a Sync'd user and have that address show up in their Exchange Online Mailbox?
01-09-2019 10:21 PM
01-09-2019 11:34 PM
You have to wait for DirSync to replicate the changes to Exchange Online, which in most cases should take less than one hour. Now, if you absolutely must change the address directly in ExO for any reason, you can use the following workaround:
Set-Mailbox user -WindowsEmailAddress email@example.com
The cmdlet above will change the primary SMTP address to firstname.lastname@example.org, while preserving the old one as secondary, regardless of whether the user is synced or not. However, now the cloud and on-premises objects will be out of sync, and this change can potentially be overwritten by DirSync in the future. So this is more of a workaround, not a supported scenario.
01-10-2019 09:13 AM
@adam deltinger wrote:
Use the proxy addresses attribute!! You set all mail addresses here and the primary in capital SMTP:
For more info and powershell cmdlets Please see following link:
thanks Adam. I understand that i can use set-aduser, aduc, and ECP. However i wanted to know how to do it using powershell, set-remotemailbox absolutely did not work, it changed it on my local object but the newly added address did not sync at all.
I just want to know how to do this with powershell.
01-10-2019 09:41 AM
OK so this worked!! Set-RemoteMailbox -Identity "Dave Bedrat" -WindowEmailAddress email@example.com
Thanks. Driving me nuts.