Edit

Share via


Get-AppRetentionCompliancePolicy

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

Use the Get-AppRetentionCompliancePolicy to view app retention compliance policies. App retention & labeling policies target new ways to scope and manage policies.

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

Syntax

Default (Default)

Get-AppRetentionCompliancePolicy
    [[-Identity] <PolicyIdParameter>]
    [-DistributionDetail]
    [-ErrorPolicyOnly]
    [-RetentionRuleTypes]
    [<CommonParameters>]

Description

*-AppRetentionCompliance* cmdlets are used for policies with adaptive policy scopes and all static policies that cover Teams private channels, Viva Engage chats, and Viva Engage community messages. Eventually, you'll use these cmdlets for most retention locations and policy types. The *-RetentionCompliance* cmdlets will continue to support Exchange and SharePoint locations primarily. For policies created with the *-AppRetentionCompliance* cmdlets, you can only set the list of included or excluded scopes for all included workloads, which means you likely need to create one policy per workload.

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.

Examples

Example 1

Get-AppRetentionCompliancePolicy | Format-Table Name,GUID

This example returns a summary list of all app retention compliance policies.

Example 1

Get-AppRetentionCompliancePolicy -Identity "Contoso Viva Engage"

This example returns detailed information for the app retention compliance policy named Contoso Viva Engage.

Parameters

-DistributionDetail

Applicable: Security & Compliance

The DistributionDetail switch returns detailed policy distribution information in the DistributionResults property. You don't need to specify a value with this switch.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ErrorPolicyOnly

Applicable: Security & Compliance

{{ Fill ErrorPolicyOnly Description }}

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Identity

Applicable: Security & Compliance

The Identity parameter specifies the app retention compliance policy that you want to view. You can use any value that uniquely identifies the policy. For example:

  • Name
  • Distinguished name (DN)
  • GUID

Parameter properties

Type:PolicyIdParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-RetentionRuleTypes

Applicable: Security & Compliance

The RetentionRuleTypes switch specifies whether to return the value of the RetentionRuleTypes property in the results. You don't need to specify a value with this switch.

To see the RetentionRuleTypes property, you need to pipe the command to a formatting cmdlet. For example, Get-AppRetentionCompliancePolicy -RetentionRuleTypes | Format-Table -Auto Name,RetentionRuleTypes. If you don't use the RetentionRuleTypes switch, the value appears blank.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.