We get the following message after assigning the license to a synchronized user in new Office 365 Tenant and it gets stuck there. This can happen when migrating from on-premise Exchange to newly created Office 365 and we use AD Connect to sync AD accounts to office 365. This can happen due to some on-premise Exchange attributes on the AD account which needs to be cleared.
It is recommended to do this per user rather than for all users in order to avoid clearing attributes for any user who is synchronizing properly.
- Log on to the Domain server and execute the following command to clear old exchange attributes.
Set-ADuser “username” -clear homeMDB,homeMTA,msExchMailboxGuid,msexchhomeservername,legacyexchangedn,msexchmailboxsecuritydescriptor,msexchpoliciesincluded,msexchrecipientdisplaytype,msexchrecipienttypedetails,msexchumdtmfmap,msexchuseraccountcontrol,msexchversion,msExchMobileMailboxFlags,msExchRBACPolicyLink,msExchTextMessagingState,msExchUserCulture,msExchWhenMailboxCreated,mDBUseDefaults,showInAddressBook,mS-DS-ConsistencyGuid,msExchBypassAudit,msExchMailboxAuditEnable,msExchMailboxAuditLogAgeLimit
2. Connect to Exchange Online PowerShell of the Tenant and remove the synchronized user from Office 365 and then also from recycle bin using the following commands.
Remove-MsolUser -UserPrincipalName email@example.com -force
Remove-MsolUser -UserPrincipalName firstname.lastname@example.org -force -RemoveFromRecycleBin
3. Check on Office 365 Portal or using PowerShell to confirm user does not exist anymore and also the in recycle bin.
get-msoluser | sort userprincipalname
4. Run AD Sync. Start ADSyncSyncCycle -PolicyType Delta
5. Check on Office 365 portal or using PowerShell to confirm that user is there now.
6. Assign the license to the user and it should pop back up as a user mailbox now.
Please Note: Always run the PowerShell commands with –Whatif switch to see what is it going to change prior to executing the command.
There was a related case where the the client had an existing Office 365 Tenant and they were getting the above error. In that case, following is what fixed the issue.