Microsoft 365 – Microsoft Graph PowerShell – way to go now

Hi All,
Greetings for the day!
Even though we already started series on Microsoft PowerShell Graph but I realise then I should have also explain why to use Microsoft Graph PowerShell – one basic introductory article.
What is Microsoft Graph PowerShell
- Microsoft Graph PowerShell is wrapper for Microsoft Graph APIs
- Using Microsoft Graph APIs in PowerShell
- Microsoft Graph PowerShell is the replacement for the Azure AD PowerShell and MSOnline modules and is recommended for interacting with Microsoft Entra ID
- Microsoft PowerShell SDK contains 2 modules
- Microsoft.Graph – this ultimately calls – Microsoft Graph REST API v1.0
- Microsoft.Graph.Beta – this ultimately calls – Microsoft Graph REST API beta
- Microsoft PowerShell SDK supports 2 types of authentication
- delegated access
- app-only access
- Each API in Microsoft Graph PowerShell is protected by one or more permission scopes. Logged in user must consent to required respective permission scopes for the API
- CMDLETs of Microsoft Graph PowerShell are directly generated from Microsoft Graph REST APIs.
- PowerShell CMDLETs are named using verb – noun pair like Get-Command. In Microsoft Graph PowerShell all nouns are prefixed with “Mg” prefix as Get-MgUser – to list all users in my tenant
- Microsoft Graph PowerShell is open source and we (users) can contribute to those
- Supports modern authentication: Microsoft Graph PowerShell supports the Microsoft Authentication Library (MSAL) which offers more security. For example, we can use passwordless sign-in experiences
Why to switch to Microsoft Graph PowerShell
- As per Microsoft – Azure AD, Azure AD Preview and MSOnline PowerShell modules are planned for depreciation.
- Microsoft Graph PowerShell is the PowerShell module should be used for interacting with Microsoft Cloud Services
- Microsoft Graph PowerShell module is compatible with Windows PowerShell 5.1 and works with PowerShell 7 and later
- We have detailed article for verifying PowerShell version – please have a look – PowerShell tutorial – How to know the current version of PowerShell on my system – https://knowledge-junction.in/2024/01/25/powershell-tutorial-how-to-know-the-current-version-of-powershell-on-my-system/
Advantages of using Microsoft Graph PowerShell module
- Microsoft Graph PowerShell is based on Microsoft Graph API. Microsoft Graph APIs include APIs for almost all Microsoft services including – Microsoft Entra ID, SharePoint, Exchange, Teams, outlook and so on. All these are accessible with single end point – https://graph.microsoft.com/ and with single access token
- Microsoft Graph PowerShell module works on all platforms including Windows, macOS, and Linux – Cross Platform
- Microsoft Graph PowerShell supports the Microsoft Authentication Library (MSAL) which offers more security. For example, we can use Passwordless sign-in experiences
- Users from other Microsoft Entra tenants can authenticate to services in our tenant with Microsoft Graph PowerShell – External users
- Microsoft Graph PowerShell commands are updated regularly to support the latest Graph API updates
Where to Start
- First step is to uninstall existing old modules like – Uninstall AzureAD PowerShell
- We have very good article to begin with Microsoft Graph Powershell. Please have a look. Microsoft 365 : PowerShell – Microsoft Graph PowerShell tutorial – Part 1 – https://knowledge-junction.in/2023/08/30/microsoft-365-powershell-microsoft-graph-powershell-tutorial-part-1/
- As per above article, if we are ready with Microsoft Graph PowerShell, next step it to map our existing CMDLETs with new Microsoft Graph PowerShell CMDLETs
- There is very detailed article for mapping existing Azure AD PowerShell and MSOnline CMDLETs with new Microsoft Graph PowerShell CMDLETs. Kindly please have a look. Find Azure AD PowerShell and MSOnline cmdlets in Microsoft Graph PowerShell – https://learn.microsoft.com/en-us/powershell/microsoftgraph/azuread-msoline-cmdlet-map?view=graph-powershell-1.0
Thanks for reading ! Stay tuned for more articles on PowerShell !
HAPPY LEARNING AHEAD 🙂 LIFE IS BEAUTIFUL

1 Response
[…] Microsoft 365 – Microsoft Graph PowerShell – way to go now – https://microsoft365hub.in/2024/01/25/microsoft-365-microsoft-graph-powershell-way-to-go-now/ […]