Hello, @Marek G,
Welcome to the Microsoft Q&A platform!
The error message suggests that the recipient "baduser_RELOCNF_7e04b752" couldn't be read from the domain controller due to potential replication delays. Here are a few steps you can try to resolve this issue:
1.Switch Out of Forest Mode: As the error message suggests, you can try switching out of Forest mode by using the following cmdlet. This allows the command to access Active Directory objects that aren't currently available in the default scope.
Remove-MailUser -Identity "baduser_RELOCNF_7e04b752" -IgnoreDefaultScope
2.Check Replication Status and Force Synchronization: Ensure that the replication between your on-premises Active Directory and Azure AD is complete. You can use the cmdlet below to check the status of your synchronization and force a synchronization if necessary.
Get-ADSyncScheduler
Start-ADSyncSyncCycle -PolicyType Delta
3.Soft Delete and Permanently Delete: As your description, if the user is still showing up, you might need to soft delete the user first and then permanently delete them. Use the next cmdlet to finish this.
Get-MailUser -Identity "baduser_RELOCNF_7e04b752" -SoftDeletedMailUser | Remove-MailUser -PermanentlyDelete
4.Check for Retention Policies: Retention policies or litigation holds can prevent deletion. Verify if any such policies are applied to the user and remove them if necessary.
5.Perform deletion in EAC: If the above steps don't resolve the issue, go to the Exchange Admin Center to delete the target user instead. Follow the steps below.
For details, please refer to https://learn.microsoft.com/en-us/exchange/recipients-in-exchange-online/manage-mail-users#use-the-eac-to-remove-mail-users.
These steps should help you troubleshoot and resolve the issue with deleting the user in EXO. Let me know if you need more detailed instructions on any of these steps!
If the answer is helpful please click on ACCEPT ANSWER as it could help other members of the Microsoft Q&A community who have similar questions and are looking for solutions.
Thank you for your support and understanding.
Best Wishes,
Alex Zhang