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.
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.
With Graph PowerShell, the replacement cmdlet is Get-MgGroupLifecyclePolicy. It works similarly, but is part of a broader and more flexible Graph-based ecosystem.
Get-MgGroupLifecyclePolicy
This command fetches all configured lifecycle policies in your tenant.
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.
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 |
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.
© Your Site Name. All Rights Reserved. Design by HTML Codex