Add-EntraLifecyclePolicyGroup

Adds a group to a lifecycle policy.

Syntax

Add-EntraLifecyclePolicyGroup
   -GroupId <String>
   -GroupLifecyclePolicyId <String>
   [<CommonParameters>]

Description

The Add-EntraLifecyclePolicyGroup cmdlet adds a group to a lifecycle policy in Microsoft Entra ID.

Examples

Example 1: Add a group to the lifecycle policy

Connect-Entra -Scopes 'Directory.ReadWrite.All'
$group = Get-EntraGroup -Filter "DisplayName eq 'Office365 group'"
$policy = Get-EntraGroupLifecyclePolicy | Select-Object -First 1
Add-EntraLifecyclePolicyGroup -GroupLifecyclePolicyId $policy.Id -GroupId $group.Id

This example adds a group to the lifecycle policy.

  • -GroupLifecyclePolicyId parameter specifies the ID of the Lifecycle Policy add to the group.
  • -GroupId parameter specifies the ID of the group add to the Lifecycle Policy.

Parameters

-GroupId

Specifies the ID of an Office365 group in Microsoft Entra ID.

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-GroupLifecyclePolicyId

Specifies the ID of the lifecycle policy object in Microsoft Entra ID.

Type:System.String
Aliases:Id
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

System.String

Outputs

System.Object