en-US

HoldCompliancePolicy

Applies to : Security & Compliance

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

Use the Set-HoldCompliancePolicy cmdlet to modify existing preservation policies in the Microsoft Purview compliance portal.

Note: The Set-HoldCompliancePolicy cmdlet is replaced by the Set-RetentionCompliancePolicy cmdlet. If you have scripts that use Set-HoldCompliancePolicy, update them to use Set-RetentionCompliancePolicy.

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-HoldCompliancePolicy -Identity "Regulation 123 Compliance" -RemoveExchangeLocation $_}.

Available cmdlets

Parameters

Name Type Default value Accepted values
RetryDistribution SwitchParameter
AddExchangeLocation MultiValuedProperty
AddPublicFolderLocation MultiValuedProperty
AddSharePointLocation MultiValuedProperty
Comment String
Enabled Boolean
RemoveExchangeLocation MultiValuedProperty
RemovePublicFolderLocation MultiValuedProperty
RemoveSharePointLocation MultiValuedProperty

Examples

Example 1

Set-HoldCompliancePolicy -Identity "Regulation 123 Compliance" -AddExchangeLocation "Kitty Petersen" -AddSharePointLocation "https://contoso.sharepoint.com/sites/teams/finance" -RemovePublicFolderLocation All -Comment "Added new counsel, 9/9/14"

This example makes the following changes to the existing preservation policy named "Regulation 123 Compliance":

  • Adds the mailbox for the user named Kitty Petersen.
  • Adds the SharePoint site https://contoso.sharepoint.com/sites/teams/finance.
  • Removes public folders.
  • Updates the comment.

Microsoft Learn documentation