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
GetQuery (Default)
Get-EntraGroupLifecyclePolicy
[-Property <String[]>]
[<CommonParameters>]
GetById
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.
-GroupLifecyclePolicyIdparameter specifies the ID of a groupLifecyclePolicies object in Microsoft Entra ID.
Parameters
-GroupLifecyclePolicyId
Specifies the ID of a groupLifecyclePolicies object in Microsoft Entra ID.
Parameter properties
| Type: | System.String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | Id |
Parameter sets
GetById
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-Property
Specifies properties to be returned
Parameter properties
| Type: | System.String[] |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | Select |
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.
Inputs
System.String
System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]