Create an Exchange Online Disclaimer Rule by Sender Country
Question details
Create an Exchange Online disclaimer rule that uses the sender's Country attribute as a condition.

- Product
- Exchange Online
- Device & OS
- not provided
- Scenario
- An administrator wants to apply a disclaimer based on the sender's country, but the User Properties option is unavailable in the Exchange admin center.
- Observed behavior
- The country condition cannot be selected in the Exchange admin center, but it can be added to an existing rule with Exchange Online PowerShell.
Confirm that you have permission to manage mail flow rules and that the sender's directory Country attribute contains the value you plan to match. Install the Exchange Online PowerShell module if needed, and identify the disclaimer rule name.
Add a sender country condition with Exchange Online PowerShell
Use this method when you can create the disclaimer rule in the Exchange admin center but cannot select User Properties.
The condition checks a sender directory attribute; it does not determine an arbitrary external sender's country from their email address or location.
In the Exchange admin center, go to Mail flow > Rules and select Add a rule > Apply disclaimers. Configure the disclaimer text, fallback action, and any other required conditions, then save the rule.
Open PowerShell and run Connect-ExchangeOnline. Sign in with an account authorized to manage mail flow rules.
Run Get-TransportRule "Your_Disclaimer" | Format-List, replacing Your_Disclaimer with the saved rule name. Check its existing conditions and actions before changing it.
Run Set-TransportRule "Your_Disclaimer" -SenderADAttributeContainsWords "Country:DE". Replace Your_Disclaimer with the rule name and DE with the value stored in the sender's Country attribute.
Run Get-TransportRule "Your_Disclaimer" | Format-List again and check the SenderADAttributeContainsWords property. Send test messages from accounts with matching and nonmatching country values to confirm the disclaimer is applied as intended.

Draft Disclaimer Text with WPS Office
WPS Office is a free, lightweight alternative for drafting and sharing disclaimer text in a familiar interface. It supports common Microsoft Office formats for an easy transition, but it does not configure Exchange Online mail flow rules.

Frequently Asked Questions
Where do I create the disclaimer rule?
In the Exchange admin center, go to Mail flow > Rules and select Add a rule > Apply disclaimers. Save the rule before adding the country condition in PowerShell.
What country value should I use in the command?
Use the value stored in the sender's directory Country attribute. For example, use Country:DE if the attribute contains DE.
Can this condition identify the country of any external sender?
No. The condition checks a directory attribute rather than inferring a country from the sender's email address or location. An external sender may not have a usable Country attribute in your organization.
How can I check whether the condition was saved?
Run Get-TransportRule "Your_Disclaimer" | Format-List in Exchange Online PowerShell and inspect SenderADAttributeContainsWords. Then send test messages from accounts with matching and nonmatching attribute values.




