SCAppRetentionComplianceRule¶
Parameters¶
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
| Name | Key | String | The name of the app retention rule. | |
| Policy | Required | String | The name of the app retention policy the rule belongs to. It cannot be changed after the rule is created. | |
| Comment | Write | String | The comment of the app retention rule. | |
| RetentionDuration | Write | String | The number of units to retain the content for, or Unlimited. | |
| RetentionDurationDisplayHint | Write | String | The unit of the RetentionDuration. | Days, Months, Years |
| RetentionComplianceAction | Write | String | The action to take once the retention duration expires. | Delete, Keep, KeepAndDelete |
| ExpirationDateOption | Write | String | Specifies whether the retention duration counts from the creation or the last modification of the content. | CreationAgeInDays, ModificationAgeInDays |
| Ensure | Write | String | Specify if the app retention rule should exist. | Present, Absent |
| Credential | Write | PSCredential | Credentials of the Global Admin | |
| ApplicationId | Write | String | Id of the Entra ID application to authenticate with. | |
| TenantId | Write | String | Id of the Entra ID tenant used for authentication. | |
| CertificateThumbprint | Write | String | Thumbprint of the Entra ID application's authentication certificate to use for authentication. | |
| CertificatePassword | Write | PSCredential | Username can be made up to anything but password will be used for CertificatePassword | |
| CertificatePath | Write | String | Path to certificate used in service principal usually a PFX file. | |
| AccessTokens | Write | String[] | Access token used for authentication. |
Description¶
This resource configures the retention settings of a Purview retention policy for apps. The policy of a rule cannot be changed after the rule is created.
Permissions¶
Office 365 Exchange Online¶
To authenticate with the Office 365 Exchange Online API, this resource requires the following permissions:
Delegated permissions¶
- Read
-
None
-
Update
- None
Application permissions¶
- Read
-
Exchange.ManageAsApp
-
Update
- Exchange.ManageAsApp
Examples¶
Example 1¶
This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.
Configuration Example
{
param
(
[Parameter()]
[System.String]
$ApplicationId,
[Parameter()]
[System.String]
$TenantId,
[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC
Node localhost
{
SCAppRetentionComplianceRule 'SCAppRetentionComplianceRule-Example'
{
Name = "Teams Channel Messages Retention Rule";
Policy = "Teams Channel Messages Retention";
Comment = "Keeps channel messages for seven years, then deletes them";
ExpirationDateOption = "CreationAgeInDays";
RetentionComplianceAction = "KeepAndDelete";
RetentionDuration = "2555";
RetentionDurationDisplayHint = "Days";
Ensure = "Present";
ApplicationId = $ApplicationId;
TenantId = $TenantId;
CertificateThumbprint = $CertificateThumbprint;
}
}
}
Example 2¶
This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.
Configuration Example
{
param
(
[Parameter()]
[System.String]
$ApplicationId,
[Parameter()]
[System.String]
$TenantId,
[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC
Node localhost
{
SCAppRetentionComplianceRule 'SCAppRetentionComplianceRule-Example'
{
Name = "Teams Channel Messages Retention Rule";
Policy = "Teams Channel Messages Retention";
Comment = "Keeps channel messages for seven years, then deletes them";
ExpirationDateOption = "CreationAgeInDays";
RetentionComplianceAction = "KeepAndDelete";
RetentionDuration = "3650"; # Updated Property
RetentionDurationDisplayHint = "Days";
Ensure = "Present";
ApplicationId = $ApplicationId;
TenantId = $TenantId;
CertificateThumbprint = $CertificateThumbprint;
}
}
}
Example 3¶
This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.
Configuration Example
{
param
(
[Parameter()]
[System.String]
$ApplicationId,
[Parameter()]
[System.String]
$TenantId,
[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC
Node localhost
{
SCAppRetentionComplianceRule 'SCAppRetentionComplianceRule-Example'
{
Name = "Teams Channel Messages Retention Rule";
Policy = "Teams Channel Messages Retention";
Ensure = "Absent";
ApplicationId = $ApplicationId;
TenantId = $TenantId;
CertificateThumbprint = $CertificateThumbprint;
}
}
}