Apparently the commands above didn’t work. And so I had to check something else.!
In order to solve the problem first
I had to assign License to the user synced on O365.
Check User’s Proxy target attribute using ADSI. (Which was correct)
Checking Archiving Attributes since the error is mentioning the Archiving option.
After checking the Archiving attributes it turns that the admin of Exchange has changed the below attributes before he assign user the license on o365 and migrate the user.
5. So deleting the value below msExchArchiveName and setting up msExchRemoteReceipeintType back to 4 have solved the problem 6. Of course DirSync needs to be applied in order to sync changes to AD on O365.
The migration for the User should be “continued” from previous migration batch in the portal otherwise if you start any new batch for the same user the result will be completed but migration won’t take place.
If you used DirSync to sync users from local to online, please try to restart the DirSync to check whether this issue persists or not.
Creating Custom Attributes on On-Premises AD for Exchange Online Users
I have came across some interesting scenario where Exchange Server doesn’t exist however some attributes might be still required or used on Office 365 for Exchange online users which are Synced with Azure Active Directory Sync tool.
The attributes might be used for different purposes but sometimes it’s very necessary so I will go ahead and demonstrate how to create a custom attribute which is normally created by default with Exchange servers deployed on-prem.
First I will run the Schema console
On one of the DC servers which are synced with Office 365 Launch CMD as Administrator
Run the following Command
Click on File -> ADD /Remove Snap in
Right Click on Attributes -> Create Attribute…
Click on Continue
Go to Attributes, Navigate to Custom attributes and double click on it and tick the boxes below then click apply
Now go to Classes
Find and double click on User
Now go to Attributes tab
Click on Add and add the Custom Attribute
Now go back to CMD on DC Server and replicate changes across all DC servers