en-US

DlpCompliancePolicy

Applies to : Security & Compliance

This cmdlet is available only in Security & Compliance PowerShell. For more information, see Security & Compliance PowerShell.

Use the Set-DlpCompliancePolicy cmdlet to modify data loss prevention (DLP) policies in the Microsoft Purview compliance portal.

For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax.

To use this cmdlet in Security & Compliance PowerShell, you need to be assigned permissions. For more information, see Permissions in the Microsoft Purview compliance portal.

Note: Don't use a piped Foreach-Object command when adding or removing scope locations: "Value1","Value2",..."ValueN" | Foreach-Object {Set-DlpCompliancePolicy -Identity "Main PII" -RemoveExchangeLocation $_}.

Available cmdlets

Parameters

Name Type Default value Accepted values
RetryDistribution SwitchParameter
AddEndpointDlpLocation MultiValuedProperty
AddEndpointDlpLocationException MultiValuedProperty
AddExchangeLocation MultiValuedProperty
AddOneDriveLocation MultiValuedProperty
AddOneDriveLocationException MultiValuedProperty
AddOnPremisesScannerDlpLocation MultiValuedProperty
AddOnPremisesScannerDlpLocationException MultiValuedProperty
AddPowerBIDlpLocation MultiValuedProperty
AddPowerBIDlpLocationException MultiValuedProperty
AddSharePointLocation MultiValuedProperty
AddSharePointLocationException MultiValuedProperty
AddTeamsLocation MultiValuedProperty
AddTeamsLocationException MultiValuedProperty
AddThirdPartyAppDlpLocation MultiValuedProperty
AddThirdPartyAppDlpLocationException MultiValuedProperty
Comment String
DisplayName String
EndpointDlpAdaptiveScopes MultiValuedProperty
EndpointDlpAdaptiveScopesException MultiValuedProperty
EnforcementPlanes MultiValuedProperty
ExceptIfOneDriveSharedBy RecipientIdParameter[]
ExceptIfOneDriveSharedByMemberOf RecipientIdParameter[]
ExchangeAdaptiveScopes MultiValuedProperty
ExchangeAdaptiveScopesException MultiValuedProperty
ExchangeSenderMemberOf RecipientIdParameter[]
ExchangeSenderMemberOfException RecipientIdParameter[]
IsFromSmartInsights System.Boolean
Locations String
Mode PolicyMode
OneDriveAdaptiveScopes MultiValuedProperty
OneDriveAdaptiveScopesException MultiValuedProperty
OneDriveSharedBy RecipientIdParameter[]
OneDriveSharedByMemberOf RecipientIdParameter[]
PolicyRBACScopes MultiValuedProperty
PolicyTemplateInfo PswsHashtable
Priority Int32
RemoveEndpointDlpLocation MultiValuedProperty
RemoveEndpointDlpLocationException MultiValuedProperty
RemoveExchangeLocation MultiValuedProperty
RemoveOneDriveLocation MultiValuedProperty
RemoveOneDriveLocationException MultiValuedProperty
RemoveOnPremisesScannerDlpLocation MultiValuedProperty
RemoveOnPremisesScannerDlpLocationException MultiValuedProperty
RemovePowerBIDlpLocation MultiValuedProperty
RemovePowerBIDlpLocationException MultiValuedProperty
RemoveSharePointLocation MultiValuedProperty
RemoveSharePointLocationException MultiValuedProperty
RemoveTeamsLocation MultiValuedProperty
RemoveTeamsLocationException MultiValuedProperty
RemoveThirdPartyAppDlpLocation MultiValuedProperty
RemoveThirdPartyAppDlpLocationException MultiValuedProperty
StartSimulation Boolean
TeamsAdaptiveScopes MultiValuedProperty
TeamsAdaptiveScopesException MultiValuedProperty

Examples

Example 1

Set-DlpCompliancePolicy -Identity "Main PII" -AddSharePointLocation "https://my.url1","https://my.url2" -AddOneDriveLocation "https://my.url3","https://my.url4"

This example adds the specified URLs to the SharePoint and OneDrive locations for the DLP policy named Main PII without affecting the existing URL values.

Example 2

Set-DlpCompliancePolicy -Identity MainPII -Mode Disable

This example disables the "MainPII" policy.

Example 3

Set-DlpCompliancePolicy -Identity "PowerBIPolicy" -AddPowerBILocation "workspaceID1","workspaceID2","workspaceID3"

This example adds the specified workspace IDs to the Power BI location for the DLP policy named PowerBIPolicy without affecting the existing workspace IDs.

Microsoft Learn documentation