First, M365-enable the user (set mailNickname, msExchAddressBookFlags etc; with our Script «M365-enable-Users.ps1»
Then, get the ImmutableId from AD User (run on a DC):
$user = Get-ADUser -Filter 'Name -like "thomas schmid"'
$immutableid = [System.Convert]::ToBase64String($user.ObjectGUID.tobytearray())
$immutableid
Now, set the ImmutableId from the AD User to the EntraID User (run in Powershell):
Install-Module AzureAD
Import-Module AzureAD
Connect-AzureAD
Get-AzureADUser > copy ObjectId of User
Get-AzureADUser -ObjectId [ObjectId] | Select UserPrincipalName,ImmutableId
Set-AzureADUser -ObjectId [ObjectId] -ImmutableId [ImmutableId from AD User]
Finally, start EntraID Sync. The Cloud-User should be merged with the AD-one.