Listen to this Post
The countdown is on! Microsoft has officially announced the retirement of the MSOnline and AzureAD PowerShell modules. After a long depreciation phase, these modules will be fully retired by late May 2025, with the process starting on March 30, 2025. This move emphasizes the shift towards Microsoft Graph PowerShell, which offers a more modern and unified API for managing Microsoft 365 services.
If you haven’t already, it’s time to migrate to Microsoft Graph PowerShell. Here’s what you need to know to ensure a smooth transition.
You Should Know:
1. Install Microsoft Graph PowerShell Module
To get started, you need to install the Microsoft Graph PowerShell module. Use the following command in PowerShell:
Install-Module -Name Microsoft.Graph -Force -AllowClobber
2. Connect to Microsoft Graph
After installation, connect to Microsoft Graph using the following command:
Connect-MgGraph -Scopes "User.Read.All", "Group.Read.All", "Directory.Read.All"
This command grants the necessary permissions to read user, group, and directory information.
3. Migrate Common Commands
Here are some common commands and their equivalents in Microsoft Graph PowerShell:
- Get Users:
- MSOnline: `Get-MsolUser`
– Microsoft Graph: `Get-MgUser` - Get Groups:
- MSOnline: `Get-MsolGroup`
– Microsoft Graph: `Get-MgGroup` - Get Licenses:
- MSOnline: `Get-MsolAccountSku`
– Microsoft Graph: `Get-MgSubscribedSku`
4. Update Scripts
If you have existing scripts using MSOnline or AzureAD modules, update them to use Microsoft Graph PowerShell. For example:
<h1>Old MSOnline Command</h1> Get-MsolUser -UserPrincipalName [email protected] <h1>New Microsoft Graph Command</h1> Get-MgUser -UserId [email protected]
5. Check Permissions
Ensure your account has the necessary permissions in Azure AD to perform tasks using Microsoft Graph PowerShell. You can check and assign permissions in the Azure portal under Azure Active Directory > API Permissions.
6. Use Beta Features
Microsoft Graph PowerShell also offers a beta version with additional features. To use it, install the beta module:
Install-Module -Name Microsoft.Graph.Beta -Force -AllowClobber
Connect to the beta endpoint:
Connect-MgGraph -Scopes "User.Read.All", "Group.Read.All", "Directory.Read.All" -UseBeta
What Undercode Say:
The retirement of MSOnline and AzureAD PowerShell modules marks a significant shift in how administrators manage Microsoft 365 services. Migrating to Microsoft Graph PowerShell is essential to stay updated with the latest tools and features. Here are some additional Linux and Windows commands to help you in your IT operations:
- Linux Command to Check Network Connectivity:
ping google.com
-
Windows Command to Check Active Directory Users:
Get-ADUser -Filter * -Property *
-
Linux Command to Monitor System Resources:
top
-
Windows Command to Check Disk Space:
Get-Volume
-
Linux Command to List Running Processes:
ps aux
-
Windows Command to Restart a Service:
Restart-Service -Name "ServiceName"
By adopting Microsoft Graph PowerShell, you’ll be better equipped to manage your environment efficiently and securely. Start your migration today to avoid disruptions and leverage the full potential of Microsoft 365.
Expected Output:
- Microsoft Graph PowerShell Module installed and connected.
- Scripts updated to use Microsoft Graph commands.
- Permissions verified and configured in Azure AD.
- Beta features explored for advanced functionality.
References:
Reported By: Jake Admindroid – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅



