We have two separate on-premise AD domains (Company1 and Company2--no trust set up between them) synchronizing to one Azure tenant and there are several users that will need to be moved from one on-premise AD domain to the other but, when I tried this in the past with several test accounts, I get synchronization errors or lost email.
Let's say John Doe used to be Company1 staff but now he's working for Company2 so I need to move his jdoe account from our Company1 AD to our Company2 AD but he would still need all his existing email. He used to log in as jdoe to a Company1 domain computer on premise but now he will be logging in to our Company2 domain computers on premise. If I removed his jdoe account in the on-prem Company1 AD and create it in the on-prem Company2 AD, he will be able to log into on-prem Company2 domain computers but, as soon as it synchronizes to O365, all of his existing jdoe@o365domain.com email will be gone.
I tried running ldifde -d “CN=jdoe,OU=OU_Name,DC=domain,DC=com” -f c:\User1.txt
and then Set-MsolUser –UserPrincipalName jdoe@o365domain.com -ImmutableId H6qERZZZw0m+X+K+WIm+/P==
but I couldn't get it to work. I couldn't find any information online where there are two on-prem domains syncing to O365 so I thought I'd ask for assistance.
How can I do this without causing synchronization errors or losing all his email? Thank you very much!