When users leave and rejoin a company sometimes it can cause conflicts in Exchange if you have a hybrid solution set up, especially if you have a retention policy enabled. One of the common error messages I see is:
Exchange: Failed to disable the mailbox <guid> due to a conflict in directory settings. To disable this mailbox first run Enable-RemoteMailbox on-premises. After the next Dirsync cycle, run Disable-RemoteMailbox on-premises to disable this mailbox in the datacenter.; Exchange: An unknown error has occurred. Refer to correlation ID:<guid>
This usually happens when a user has a Exchange Online mailbox combined with a object entity on-premise which aren’t linked, luckily the fix for this is a simple one.
1) Open up your Exchange PowerShell and type ‘Set-ADServerSettings -ViewEntireForest $True’
2) Follow this by then typing ‘Enable-RemoteMailbox -Identity ‘Firstname.Lastname@company.com
3) Once done you will need to connect to the Exchange Online Powershell Module as an Exchange Administrator and run the following command to get the Exchange GUID of the same users Online mailbox ‘Get-Mailbox -Idenity Firstname.Lastname@company.com | fl *guid*’
4) Now you will want to go back to the On-premise Exchange PowerShell and run the following ‘Set-RemoteMailbox -Identity ‘Firstname.Lastname@company.com’ -ExchangeGuid <Exchange GUID taken from the Online PowerShell>
5) Run a DirSync
Hope this blog helps!