Importing DLP Rules into eSHARE
Overview
eSHARE enforces data governance by evaluating DLP rules against files shared inside a Trusted Share. These rules are sourced from your Microsoft 365 compliance configuration and must be explicitly imported into the eSHARE platform before they can be associated with DLP Tags.
This article describes the two-stage process for importing DLP rules:
Extract your existing DLP compliance rules from your Microsoft 365 tenant using PowerShell.
Import the extracted rules into eSHARE using the Add Rules option in the Admin Console.
Note: DLP rules that are already present in eSHARE do not need to be re-imported. Only run this procedure when new rules have been created in Microsoft Purview and need to be made available in eSHARE. |
Part 1: Extracting DLP Rules via PowerShell
Use the Security & Compliance PowerShell module to retrieve all DLP compliance rules configured in your Microsoft 365 tenant. The output will be saved as a plain-text file and used in Part 2 to import the rules into eSHARE.
Prerequisites
The ExchangeOnlineManagement PowerShell module (version 3.0 or later) must be installed on your machine.
Your Microsoft 365 account must have the Global Administrator or Compliance Administrator role.
PowerShell 5.1 or PowerShell 7+ is required.
Extracting DLP rules
Step 1: Open a PowerShell session
Launch Windows PowerShell or PowerShell 7 as an administrator on your local machine.
Step 2: Connect to the Security & Compliance endpoint
Run the following command to authenticate and connect to your tenant's Security & Compliance PowerShell endpoint:
Connect-IPPSSession |
A browser window or credential prompt will appear. Sign in with your Microsoft 365 administrator account. Once authenticated, the session will be established and the prompt will return.
Step 3: Retrieve all DLP compliance rules
Run the following command to display all DLP compliance rules configured in your tenant:
Get-DlpComplianceRule | Format-List |
This returns the full details of each DLP rule in list format, including rule names, conditions, actions, and parent policy information.
Step 4: Save the output to a text file
Copy the full output from the PowerShell window and paste it into a plain-text file (e.g. Notepad), then save the file with a .txt extension — for example:
dlp_rules_export.txt
Alternatively, you can redirect the output directly to a file by running:
Get-DlpComplianceRule | Format-List | Out-File -FilePath ".\dlp_rules_export.txt" -Encoding UTF8 |
Keep this file accessible — it will be uploaded into eSHARE in Part 2.
Important: Do not modify the contents of the exported text file. eSHARE parses the raw PowerShell output to identify rule definitions. Editing the file may cause rules to fail import or be imported incorrectly. |
Part 2: Importing DLP Rules into eSHARE
Once you have the exported .txt file from Part 1, navigate to the eSHARE Admin Console to import the rules.
Importing DLP Rules
Step 1: Open the Admin Console
Sign in to the eSHARE Admin Console and navigate to the Sensitivity Labels & DLP Tags section from the Admin console navigation menu.
Step 2: Open DLP Tag Settings
Click the DLP Tag Settings button located in the upper-right area of the Sensitivity Labels & DLP Tags page. A menu will appear with two options: Add Tag and Add Rules.
.png?sv=2022-11-02&spr=https&st=2026-04-11T16%3A06%3A06Z&se=2026-04-11T16%3A19%3A06Z&sr=c&sp=r&sig=rp8qItkYeIaLGBMNl%2Bl0teIhkBMkmblxoIXLLpcMydk%3D)
Step 3: Select Add Rules
Click Add Rules. A file upload dialog will appear.
.png?sv=2022-11-02&spr=https&st=2026-04-11T16%3A06%3A06Z&se=2026-04-11T16%3A19%3A06Z&sr=c&sp=r&sig=rp8qItkYeIaLGBMNl%2Bl0teIhkBMkmblxoIXLLpcMydk%3D)
Step 4: Upload the exported text file
Select the .txt file you exported in Part 1 (e.g. dlp_rules_export.txt) and confirm the upload. eSHARE will parse the file and import any new DLP rules found within it.
Step 5: Verify the imported rules
After the import completes, review the DLP rules available in eSHARE. The newly imported rules will be available for selection when creating or editing a DLP Tag via the Add Tag option.
Note: Importing rules does not automatically create DLP Tags or associate rules with a Sharing Policy. After importing, use the Add Tag option to create a DLP Tag that references the imported rules and assign it to the appropriate Sharing Policy. |