On-premises user isn’t receiving emails from online user
First we must move the user to un synced OU
The log in the the server which have the Azure AD sync tool
And open the windows azure active directory tool
Now that we have moved the user in a unsynchronized OU and that it’s appearing in the “Deleted users” section, you have to forcefully delete the user so you won’t have to wait for 30 days:
Run the following command
In the azure power shell
Start-ADSyncSyncCycle -PolicyType Delta
Then open the PowerShell and connect to the online exchange
Use the following command
Import-Module MSOnline
$O365Cred = Get-Credential
$O365Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $O365Cred -Authentication Basic -AllowRedirection
Import-PSSession $O365Session
Connect-MsolService -Credential $O365Cred
Then run the following to get the object ID
Get-MsolUser -ReturnDeletedUsers | FL -Property ObjectId,displayname
We must get the user objectID
Remove-MsolUser -ObjectId 080535c0-061a-4b0e-a6fe-48ed7fc9159d -RemoveFromRecycleBin -Force
Note: make sure you enter the correct ObjectId
After deleting the user, you will have to make sure his cloud mailbox is also deleted using one of the following cmdlets:
Get-Mailbox -Identity “username@domain.com | Remove-Mailbox -PermantentlyDelete $true
Get-Mailbox -SoftDeletedMailbox “ username@domain.com ” | Remove-Mailbox -PermantentlyDelete $true
Now do another delta sync in the azure AD server
Start-ADSyncSyncCycle -PolicyType Delta
After the cloud user and cloud mailbox are completely removed from the tenant, move the user from your local AD back into the synchronized OU, do a Delta Sync and then wait for the user to appear again in the Office 365 cloud, under Active users. Do not assign a license to the user.
Now move him back to the synced OU
And run the command
Start-ADSyncSyncCycle -PolicyType Delta
Leave a Reply