Create an Azure AD Connect Rule to Exclude Users Without a Mail Attribute
Question details
Create a synchronization rule that excludes users whose mail attribute is not populated.

- Product
- Microsoft Entra Connect Sync (formerly Azure AD Connect)
- Device & OS
- not provided
- Scenario
- An administrator wants to prevent thousands of users without mail properties from synchronizing to Microsoft Entra ID.
- Observed behavior
- User objects without mail values are in scope for synchronization, while mail-enabled users have an msExchRecipientTypeDetails value.
Identify the Active Directory connector and verify which users have a null mail attribute, including any accounts that must remain in Microsoft Entra ID. Test the rule on a staging server or a small pilot scope before applying it broadly.
Create an Inbound Rule That Filters Users With a Null Mail Attribute
Use an attribute-based inbound rule to mark matching users for exclusion from synchronization.
This approach checks the mail attribute directly. If msExchRecipientTypeDetails is the intended eligibility criterion instead, validate its values across the affected accounts before changing the rule.
Applying the filter to users already synchronized can delete their Microsoft Entra ID objects. Review the proposed exports and the accidental-deletion threshold before proceeding.
On the Microsoft Entra Connect Sync server, open Synchronization Rules Editor and select Inbound. Click Add new rule.
Give the rule a descriptive name, select the relevant Active Directory connector, set the connected system object type to user and the metaverse object type to person, and choose Join as the link type. Assign an unused precedence value that gives the rule priority over conflicting rules.
Under Scoping filter, add a clause for the mail attribute with the ISNULL operator. Add any necessary pilot or exception conditions and verify that they select only the intended users.
Under Transformations, add a constant flow with True as the source and cloudFiltered as the target attribute. Save the rule.
In Synchronization Service Manager, use the connector space search and Preview on representative users with and without mail values. Run the required full synchronization for the affected connector in the test environment, then inspect pending exports before allowing changes to reach Microsoft Entra ID.

Review Your User Inventory With WPS Spreadsheets
WPS Office is a free, lightweight Office alternative with a familiar interface and Microsoft Office format compatibility. Use WPS Spreadsheets to review an exported user inventory as part of your migration workflow; it does not configure or fix Microsoft Entra Connect synchronization rules.

Frequently Asked Questions
Will the rule remove users who are already synchronized?
It can. Users newly excluded by the rule may be deleted from Microsoft Entra ID. Check pending exports in Synchronization Service Manager and assess the impact before applying the rule in production.
Should I filter on mail or msExchRecipientTypeDetails?
Use mail with ISNULL if the requirement is specifically to exclude users without a mail value. Use msExchRecipientTypeDetails only if its validated values are a reliable indicator of the users you want to include.
How can I test the rule before a broad rollout?
Use a staging server or add a pilot condition to the rule's Scoping filter. In Synchronization Service Manager, preview representative users and review pending exports before enabling production changes.
Where can I find Microsoft's filtering guidance?
See the Microsoft Entra Connect Sync attribute-based filtering documentation at https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-sync-configure-filtering.




