New-CaseHoldRule

 

Applies to: Office 365 Security & Compliance Center

Topic Last Modified: 2017-04-21

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

Use the New-CaseHoldRule cmdlet to create new case hold rules in the Security & Compliance Center.

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

New-CaseHoldRule -Name <String> -Policy <PolicyIdParameter> [-Comment <String>] [-ContentDateFrom <DateTime>] [-ContentDateTo <DateTime>] [-ContentMatchQuery <String>] [-Disabled <$true | $false>] <COMMON PARAMETERS>

New-CaseHoldRule -Policy <PolicyIdParameter> <COMMON PARAMETERS>

New-CaseHoldRule -Policy <PolicyIdParameter> <COMMON PARAMETERS>

New-CaseHoldRule -Policy <PolicyIdParameter> <COMMON PARAMETERS>

COMMON PARAMETERS: [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

This example creates a new case hold rule named 2016 Budget Spreadsheets and adds it to the existing case hold policy named "Internal Company Policy". The rule applies to Excel worksheets that contain the phrase 2016 budget, such as "2016 budget planning.xlsx" and "2016 budget review.xlsx"

New-CaseHoldRule -Name "2016 Budget Spreadsheets" -Policy "Internal Company Policy" -ContentMatchQuery "filename:2016 budget filetype:xlsx"

You need to add the case hold rule to an existing case hold policy using the Policy parameter. Only one rule can be added to each case hold policy.

You need to be assigned permissions in the Office 365 Security & Compliance Center before you can use this cmdlet. For more information, see Permissions in Office 365 Security & Compliance Center.

 

Parameter Required Type Description

Name

Required

System.String

The Name parameter specifies a unique name for the case hold rule. If the value contains spaces, enclose the value in quotation marks.

Policy

Required

Microsoft.Office.CompliancePolicy.Tasks.PolicyIdParameter

The Policy parameter specifies the case holdpolicy that contains the rule. You can use any value that uniquely identifies the policy. For example:

  • Name

  • Distinguished name (DN)

  • GUID

Comment

Optional

System.String

The Comment parameter specifies an optional comment. If you specify a value that contains spaces, enclose the value in quotation marks ("), for example: "This is an admin note".

Confirm

Optional

System.Management.Automation.SwitchParameter

The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on if the cmdlet requires confirmation before proceeding.

  • Destructive cmdlets (for example, Remove-* cmdlets) have a built-in pause that forces you to acknowledge the command before proceeding. For these cmdlets, you can skip the confirmation prompt by using this exact syntax: -Confirm:$false.

  • Most other cmdlets (for example, New-* and Set-* cmdlets) don't have a built-in pause. For these cmdlets, specifying the Confirm switch without a value introduces a pause that forces you acknowledge the command before proceeding.

ContentDateFrom

Optional

System.DateTime

The ContentDateFrom parameter specifies the start date of the date range.

Use the short date format that's defined in the Regional Options settings on the computer where you're running the command. For example, if the computer is configured to use the short date format mm/dd/yyyy, enter 09/01/2015 to specify September 1, 2015. You can enter the date only, or you can enter the date and time of day. If you enter the date and time of day, enclose the value in quotation marks ("), for example, "09/01/2015 5:00 PM".

ContentDateTo

Optional

System.DateTime

The ContentDateTo parameter specifies the end date of the date range.

Use the short date format that's defined in the Regional Options settings on the computer where you're running the command. For example, if the computer is configured to use the short date format mm/dd/yyyy, enter 09/01/2015 to specify September 1, 2015. You can enter the date only, or you can enter the date and time of day. If you enter the date and time of day, enclose the value in quotation marks ("), for example, "09/01/2015 5:00 PM".

ContentMatchQuery

Optional

System.String

The ContentMatchQuery parameter specifies a content search filter.

This parameter uses a text search string or a query that's formatted by using the Keyword Query Language (KQL). For more information about KQL, see Keyword Query Language syntax reference.

Disabled

Optional

System.Boolean

The Disabled parameter specifies whether the case hold rule is enabled or disabled. Valid values are:

  • $true   The rule is disabled.

  • $false   The rule is enabled. This is the default value.

WhatIf

Optional

System.Management.Automation.SwitchParameter

This parameter is reserved for internal Microsoft use.

To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types. If the Input Type field for a cmdlet is blank, the cmdlet doesn’t accept input data.

To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types. If the Output Type field is blank, the cmdlet doesn’t return data.

 
Show: