Get-EntraGroupLifecyclePolicy

Retrieves the properties and relationships of a groupLifecyclePolicies object in Microsoft Entra ID. If you specify no parameters, this cmdlet gets all groupLifecyclePolicies.

Syntax

Get-EntraGroupLifecyclePolicy
   [-Property <String[]>]
   [<CommonParameters>]
Get-EntraGroupLifecyclePolicy
   -GroupLifecyclePolicyId <String>
   [-Property <String[]>]
   [<CommonParameters>]

Description

The Get-EntraGroupLifecyclePolicy command retrieves the properties and relationships of a groupLifecyclePolicies object in Microsoft Entra ID. Specify the -GroupLifecyclePolicyId parameter to get the group lifecycle policy. If you specify no parameters, this cmdlet gets all groupLifecyclePolicies.

Examples

Example 1: Retrieve all groupLifecyclePolicies

Connect-Entra -Scopes 'Directory.Read.All'
Get-EntraGroupLifecyclePolicy

Id                                   AlternateNotificationEmails GroupLifetimeInDays ManagedGroupTypes
--                                   --------------------------- ------------------- -----------------
eeeeeeee-4444-5555-6666-ffffffffffff example@contoso.com                     200                 Selected

This example demonstrates how to retrieve the properties and relationships of all groupLifecyclePolicies in Microsoft Entra ID.

Example 2: Retrieve properties of an groupLifecyclePolicy

Connect-Entra -Scopes 'Directory.Read.All'
$policy = Get-EntraGroupLifecyclePolicy | Where-Object {$_.AlternateNotificationEmails -eq 'example@contoso.com'}
Get-EntraGroupLifecyclePolicy -GroupLifecyclePolicyId $policy.Id

Id                                   AlternateNotificationEmails GroupLifetimeInDays ManagedGroupTypes
--                                   --------------------------- ------------------- -----------------
ffffffff-5555-6666-7777-aaaaaaaaaaaa example@contoso.com                     200                 Selected

This command is used to retrieve a specific Microsoft Group Lifecycle Policy.

  • -GroupLifecyclePolicyId parameter specifies the ID of a groupLifecyclePolicies object in Microsoft Entra ID.

Parameters

-GroupLifecyclePolicyId

Specifies the ID of a groupLifecyclePolicies 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

-Property

Specifies properties to be returned

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

Inputs

System.String

System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

Outputs

System.Object