Migrating from Get-AzureADMSGroupLifecyclePolicy to Get-MgGroupLifecyclePolicy

As Microsoft deprecates the AzureAD module, administrators must move to the Microsoft Graph PowerShell SDK for managing Microsoft 365 resources. If you're responsible for managing the lifecycle of Microsoft 365 groups — such as automatic expiration and renewal policies — you likely used Get-AzureADMSGroupLifecyclePolicy. The modern equivalent is Get-MgGroupLifecyclePolicy.

In this guide, you’ll learn how to replace Get-AzureADMSGroupLifecyclePolicy with Get-MgGroupLifecyclePolicy, understand key differences, and explore examples to integrate the new cmdlet into your workflow.


What You Did Previously with Get-AzureADMSGroupLifecyclePolicy

The Get-AzureADMSGroupLifecyclePolicy cmdlet allowed you to retrieve information about existing group lifecycle policies, which help administrators manage the expiration and renewal of Microsoft 365 groups.

Example

Get-AzureADMSGroupLifecyclePolicy

You could also retrieve a specific policy if you knew the policy ID:

Get-AzureADMSGroupLifecyclePolicy -Id "12345abc-6789-defg-1234-567890hijkl"

This was useful for viewing policies that enforced expiration timelines and sending renewal notifications to group owners.


What You Should Do Now with Get-MgGroupLifecyclePolicy

With Graph PowerShell, the replacement cmdlet is Get-MgGroupLifecyclePolicy. It works similarly, but is part of a broader and more flexible Graph-based ecosystem.


Retrieve All Group Lifecycle Policies

Get-MgGroupLifecyclePolicy

This command fetches all configured lifecycle policies in your tenant.


Retrieve a Specific Group Lifecycle Policy by ID

If you know the policy ID:

Get-MgGroupLifecyclePolicy -GroupLifecyclePolicyId "12345abc-6789-defg-1234-567890hijkl"

This helps in automation scenarios where policies are tracked by ID.


What’s Different with Get-MgGroupLifecyclePolicy?


Old (Get-AzureADMSGroupLifecyclePolicy) New (Get-MgGroupLifecyclePolicy)
AzureAD module (deprecated) Microsoft.Graph.Groups.LifecyclePolicies module
Returns basic policy objects Returns Microsoft Graph-compliant policy objects
Limited automation capability Easily scriptable with Graph-based tooling and integrations
No Graph API support Fully backed by the Microsoft Graph API

Conclusion

Migrating from Get-AzureADMSGroupLifecyclePolicy to Get-MgGroupLifecyclePolicy ensures you're aligned with Microsoft’s future-ready Graph-based administration model. The syntax remains familiar, but the flexibility and power of Graph make it far more capable for modern automation.

If you're managing group expiration, renewal notifications, or compliance policies around inactive groups, Get-MgGroupLifecyclePolicy is the cmdlet to use moving forward.

Visit M365Corner.com for ready-to-use free Microsoft Graph PowerShell tools and step-by-step migration guides built for Microsoft 365 administrators.



Permission Required

Example:


                                


                                


                                

© Your Site Name. All Rights Reserved. Design by HTML Codex