Edit

Share via


Set-EntraGroupLifecyclePolicy

Updates a specific group Lifecycle Policy in Microsoft Entra ID.

Syntax

Default (Default)

Set-EntraGroupLifecyclePolicy

    -GroupLifecyclePolicyId <String>
    [-AlternateNotificationEmails <String>]
    [-GroupLifetimeInDays <Int32>]
    [-ManagedGroupTypes <String>]
    [<CommonParameters>]

Description

The Set-EntraGroupLifecyclePolicy command updates a specific group Lifecycle Policy in Microsoft Entra ID.

Examples

Example 1: Updates group lifecycle policy

Connect-Entra -Scopes 'Directory.ReadWrite.All'
$policy = Get-EntraGroupLifecyclePolicy | Where-Object {$_.AlternateNotificationEmails -eq 'example@contoso.com'}
Set-EntraGroupLifecyclePolicy -GroupLifecyclePolicyId $policy.Id -GroupLifetimeInDays 200 -AlternateNotificationEmails 'example@contoso.com' -ManagedGroupTypes 'All'
Id                                   AlternateNotificationEmails GroupLifetimeInDays ManagedGroupTypes
--                                   --------------------------- ------------------- -----------------
ffffffff-5555-6666-7777-aaaaaaaaaaaa example@contoso.com                     200                 All

This example updates the specified groupLifecyclePolicy in Microsoft Entra ID.

  • -GroupLifecyclePolicyId parameter specifies the ID of the Lifecycle Policy to be modified.
  • -GroupLifetimeInDays parameter specifies the lifetime of the groups in the policy to 200 days. The GroupLifetimeInDays represents the number of days before a group expires and needs to be renewed. Once renewed, the group expiration is extended by the number of days defined.
  • -AlternateNotificationEmails parameter specifies the email address that receives notifications about the policy. Multiple email address can be defined by separating email address with a semicolon.
  • -ManagedGroupTypes parameter specifies which office 365 groups the policy applies to. Possible values are All, Selected, or None. In this case, 'All' suggests that the policy manages all types of groups.

Parameters

-AlternateNotificationEmails

Notification emails for groups that have no owners are sent to these email addresses. List of email addresses separated by a ";".

Parameter properties

Type:System.String
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

-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

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

-GroupLifetimeInDays

The number of days a group can exist before it needs to be renewed.

Parameter properties

Type:System.Int32
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

-ManagedGroupTypes

Allows the admin to select which office 365 groups the policy applies to.

  • "None" will create the policy in a disabled state.
  • "All" will apply the policy to every Office 365 group in the tenant.
  • "Selected" will allow the admin to choose specific Office 365 groups that the policy applies to.

Parameter properties

Type:System.String
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.

Inputs

System.String

Outputs

System.Object