Forum Discussion
SMTP-addresses not in sync with AD
We have an AADSync enabled tenant syncing the users to Office 365 and have ADFS running. We have NO Exchange hybrid setup. Mailboxes are on-premises Exchange.
I accidently created for some users a Mailbox and deleted it again. With this, the primary SMTP-address changed from the right mailadress, which was synced from AD, to the tenants xxx.onmicrosoft.com
I just want to change it back to the primary SMTP-address of the on-premises Mailbox which worked well until i created the mailboxes.
I tried to temporary change the primary SMTP on-premises and change it back. But the first change worked, the change back not. Some ideas? Is it possible to change the SMTP-addresses in O365 or is it possible to "force" a sync from AD?
Thanks!
You should be able to use the -WindowsEmailAddress parameter for this. The new address you specify should be set as the Primary SMTP, while the old primary one will be kept as secondary. The cmdlet will also work against synced users.
If that's not a viable solution for your scenario, you can force-delete the mailbox in O365 and provision the object anew. Use the method outlined here for fastest resolution: https://blogs.technet.microsoft.com/exchange/2018/01/17/permanently-clear-previous-mailbox-info/
9 Replies
- Nathan McClintockCopper Contributor
How about the Set-MsolUserPrincipalName command?
- Jonathan Klein-WieleCopper Contributor
Thanks for your feedback, I tried all your hints but none worked... But we will move in the next weeks to hybrid and I hope problems are gone then.
- Pablo R. OrtizSteel Contributor
if you don't comnpletely remove the EXO created mailboxes, Hybrid/Migration won't work for those
- Pablo R. OrtizSteel Contributor
How did you remove the online mailbox? Please refer to the following:
https://technet.microsoft.com/en-us/library/jj863440(v=exchg.160).aspx
Then you can add SMTP:user@domain.com in ProxyAddresses property of local AD. Note that it can take some time to appear in the online user (more tan a sync cycle)
- Jonathan Klein-WieleCopper ContributorI just disabled the Licence of "Exchange Online". In local AD the property is set correct, so adding is not possible. I also tried to remove the adress in local Exchange, sync and add it again. Didn't work.
- Pablo R. OrtizSteel Contributor
By disabling the license you are not removing the mailbox
Please refer to the article I posted in order to permanently delete EXO mailbox
- Jonathan Klein-WieleCopper Contributorset-mailuser -Identity abc -EmailAddresses @{Add="abc@abc.de"} did not work: The operation on mailbox "abc" failed because it's out of the current user's write scope. The action 'Set-MailUser', 'EmailAddresses', can't be performed on the object
abc' because the object is being synchronized from your on-premises organization. This action should be performed on the object in your on-premises organization. But if I Change on-premises it doesn't workYou should be able to use the -WindowsEmailAddress parameter for this. The new address you specify should be set as the Primary SMTP, while the old primary one will be kept as secondary. The cmdlet will also work against synced users.
If that's not a viable solution for your scenario, you can force-delete the mailbox in O365 and provision the object anew. Use the method outlined here for fastest resolution: https://blogs.technet.microsoft.com/exchange/2018/01/17/permanently-clear-previous-mailbox-info/
- Jonathan Klein-WieleCopper Contributor
Ok, thanks guys, seems that the reply from Vasil worked. It needed some time but now I got the mails and could fix the issue!
Thanks also for all the other hints!