Export and Restore Custom Sync Rules in Azure AD Connect
Question details
Export custom synchronization rules before an Azure AD Connect upgrade and restore them if needed afterward.
- Product
- Azure AD Connect
- Device & OS
- not provided
- Scenario
- Preparing for an in-place upgrade while preserving custom synchronization rule settings.
- Observed behavior
- Custom rules need to be exported before upgrading, and changes made directly to default rules can be overwritten by later updates.
Identify the Azure AD Connect sync server and confirm you have permission to inspect and export its synchronization rules. Record each custom rule’s precedence and scope, and check the upgrade plan for configuration export options available in your version.
Export Custom Sync Rules and Restore Them After the Upgrade
Use the Synchronization Rules Editor to generate PowerShell scripts before upgrading, then recreate any missing rules and verify their settings.
On the sync server, open Synchronization Rules Editor and review the inbound and outbound rules to identify your custom rules.
Select a custom rule and choose Export to generate its PowerShell script. Save the script in a secure location and repeat for each custom rule.
In Synchronization Rules Editor, record each rule’s name, direction, precedence, scope, and other relevant settings. If your Azure AD Connect version offers a configuration export option, use it as an additional record.
After the upgrade, reopen Synchronization Rules Editor and compare the rules with your exported scripts and notes. Identify missing or changed custom rules before attempting a restore.
Review the relevant exported script, then run it in an elevated PowerShell session on the sync server using the supported method for your configuration. Reopen Synchronization Rules Editor to check the rule’s precedence and scope, and use Synchronization Service Manager to preview synchronization for a representative object.

Document Your Sync Rule Inventory in WPS Spreadsheets
Use the free, lightweight WPS Office suite to maintain an upgrade checklist and rule inventory in a familiar interface. WPS supports common Microsoft Office formats for easy migration, but it does not manage or restore Azure AD Connect rules.

Frequently Asked Questions
What does exporting a custom synchronization rule create?
In Synchronization Rules Editor, select the rule and choose Export. The export generates a PowerShell script that can be used to recreate the rule.
Should I run every exported script after the upgrade?
No. First compare the rules in Synchronization Rules Editor with your exports and notes. Review and run a script only when the corresponding rule needs to be recreated.
Why should I avoid changing default sync rules directly?
Azure AD Connect updates can overwrite changes made directly to default rules. Follow Microsoft’s supported guidance for replacing default behavior with custom rules.
How can I check a restored rule before relying on it?
Check its direction, precedence, and scope in Synchronization Rules Editor, then use Synchronization Service Manager to preview synchronization for a representative object.




