Others

Create an Exchange Online Disclaimer Rule by Sender Country

Huda QurayshiHuda Qurayshi Nov 14, 2026 868 views

Question details

Create an Exchange Online disclaimer rule that uses the sender's Country attribute as a condition.

Create an Exchange Online Disclaimer Rule by Sender Country
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.
Before you start

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.

Solution 1Recommended

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.

1
Create the disclaimer rule

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.

2
Connect to Exchange Online

Open PowerShell and run Connect-ExchangeOnline. Sign in with an account authorized to manage mail flow rules.

3
Inspect the rule

Run Get-TransportRule "Your_Disclaimer" | Format-List, replacing Your_Disclaimer with the saved rule name. Check its existing conditions and actions before changing it.

4
Add the country condition

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.

5
Verify and test

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.

Add a sender country condition with Exchange Online PowerShell
Check external sender scenarios: An external sender may not have a usable directory Country attribute in your organization. Test the rule with the actual sender types you intend to cover.
Free Microsoft Office alternative

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.

Draft and review disclaimer wording in WPS WriterOpen and save Microsoft Word DOCX filesUse a familiar interface for everyday document editingWork with a free, lightweight office suite
microsoft office alternative - wps office

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.