Fix Exchange Set-SyncMailUser Cmdlet and Remote Mailbox Errors
Question details
The user needs to resolve synchronization failures with the Set-SyncMailUser cmdlet and fix errors preventing a remote mailbox from provisioning.

- Product
- Microsoft Exchange and Microsoft Entra ID
- Device & OS
- not provided
- Scenario
- The issue occurred after moving a user account from a synchronized Active Directory OU to an unsynchronized OU, permanently deleting the user from Azure AD, and then moving the account back to synchronize again.
- Observed behavior
- The Set-SyncMailUser cmdlet fails, and the remote mailbox cannot be provisioned due to stale Exchange attributes or a conflicting ExchangeGUID syncing to the new Microsoft Entra ID user.
Before making destructive changes to directory attributes, back up the user's remote mailbox information and verify their synchronization status in the Microsoft Entra Connect Synchronization Service.
Clear Stale Remote Mailbox Attributes and Run a Delta Sync
Use this method to safely remove conflicting Exchange attributes and an existing ExchangeGUID, allowing Microsoft Entra ID to provision the mailbox correctly.
When an Active Directory user is moved out of scope and back into a synchronized OU, Microsoft Entra ID may treat it as a new object. However, old Exchange attributes like the ExchangeGUID can persist and block the provisioning of a new mailbox. Running the Disable-RemoteMailbox cmdlet clears these attributes without deleting the local AD account.
Log in to the Microsoft 365 Admin Center and temporarily unassign the user's Exchange Online license.
On your on-premises Exchange server, open the Exchange Management Shell and run 'Disable-RemoteMailbox' for the affected Active Directory user. This removes the stale remote mailbox and Exchange attributes while preserving the AD account.
Open PowerShell on your Azure AD Connect server and execute 'Start-ADSyncSyncCycle -PolicyType Delta' to force an immediate synchronization to Microsoft Entra ID.
Once the directory changes have successfully synchronized, assign the Exchange Online license back to the user in the Microsoft 365 Admin Center.
Check Exchange Online to confirm that the mailbox now provisions successfully. If necessary, you can manually recreate the remote mailbox afterwards.

Manage IT Documentation Efficiently with WPS Office
While WPS Office cannot directly resolve Microsoft Exchange directory synchronization issues, it is the perfect lightweight alternative for managing your IT logs, PowerShell scripts, and administrative documentation. Enjoy full compatibility with Microsoft Office formats without the expensive subscription.
- 1. Download WPS Office: Visit the official WPS website and download the free WPS Office installer for your operating system.
- 2. Document Your IT Procedures: Open WPS Writer to create comprehensive standard operating procedure (SOP) documents for handling Exchange provisioning errors.
- 3. Save and Share in Office Formats: Save your technical documentation as standard Word or PDF files to easily share them with your IT department.

Frequently Asked Questions
Why does the Set-SyncMailUser cmdlet fail after moving a user's OU?
Moving a user to an unsynchronized Organizational Unit (OU) and back can cause Microsoft Entra ID to treat them as a new object. If old Exchange attributes like ExchangeGUID are still present, they create conflicts that prevent the cmdlet from executing successfully.
How can I check if an Active Directory user synchronized to Entra ID successfully?
You can run the Get-AzureADUser PowerShell cmdlet to verify the user object. Alternatively, open the Azure AD Connect Synchronization Service, go to Metaverse Search, and check the inbound and outbound connectors for the specific user.
Will running Disable-RemoteMailbox delete my on-premises Active Directory account?
No. The Disable-RemoteMailbox cmdlet only clears the remote mailbox configuration and associated Exchange attributes. Your local Active Directory user account remains fully intact.




