In this guide, I’ll show you how to install Microsoft Graph PowerShell module. The Graph PS module provides a way to manage and automate tasks across Microsoft 365 services, including Entra ID, Exchange Online, Outlook, SharePoint, Teams, and more.
The Microsoft Graph PowerShell SDK essentially comes in two modules: Microsoft.Graph and Microsoft.Graph.Beta. The modules interact with the Microsoft Graph v1.0 and Microsoft Graph beta endpoints, respectively, and can be installed together on the same version of PowerShell.
Tip: To manage the Exchange Online component of your Microsoft 365 organization directly through the command line, see how to install the exchange online PowerShell module.

Key Features & Benefits of Microsoft Graph PowerShell SDK
Using the Microsoft Graph PowerShell SDK provides the following features and benefits for your organization.
- Unified Access to Microsoft 365 Services: Microsoft Graph PowerShell module connects to the Microsoft Graph API, providing access to data and resources across Microsoft 365 services such as Microsoft Entra, Intune, etc.
- Automation: Using Graph SDK cmdlets, you can automate administrative tasks like user management, group creation, license assignments, and more.
- Supports external identities: Users from external Microsoft Entra tenants can use Microsoft Graph PowerShell SDK to authenticate to services within your tenant.
- Cross-Platform Support: Microsoft Graph PowerShell works on all platforms, including Windows, macOS, and Linux.
- Requires least privileges: Microsoft Graph PowerShell permissions are not pre-authorized, requiring users to submit a one-time request for app permissions based on their specific needs.
- Secure Authentication: Supports authentication methods like interactive sign-in, certificate-based authentication, and managed identity (for Azure resources).
- Receives regular updates: Microsoft frequently updates Graph PowerShell commands to align with the latest enhancements and features of the Graph API.
Check out the complete list of Microsoft Graph PowerShell features & benefits.
Prerequisites
The following prerequisites are required to use the Microsoft Graph PowerShell SDK with Windows PowerShell.
- Ensure you have installed PowerShell 5.1 or later. PowerShell 7 and later is the recommended PowerShell version for use with the Microsoft Graph PowerShell SDK on all platforms.
- You must have installed .NET Framework 4.7.2 or later.
- You must update PowerShellGet to the latest version using the Install-Module PowerShellGet cmdlet.
- The PowerShell script execution policy must be set to remote signed or less restrictive.
Steps to Install Microsoft Graph PowerShell Module
I will now guide you through the steps to installing the Microsoft Graph PowerShell Module, following Microsoft’s official instructions to ensure a smooth and error-free installation.
Step 1: Set PS Execution Policy to RemoteSigned
To install the Microsoft Graph PowerShell module, ensure the PowerShell execution policy is set to RemoteSigned. To accomplish that, open the PowerShell as administrator and run the below command to change the PS execution policy from Restricted to RemoteSigned on the current device.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Step 2: Install Microsoft PowerShellGet Module
Open the PowerShell as administrator and run the below command to install the latest version of PowerShellGet.
Install-Module PowerShellGet -Force -AllowClobberRun the following command to verify the installed version of the PowerShellGet module.
Get-Module PowerShellGet -ListAvailable
Step 3: Install Microsoft Graph PowerShell Module
The Install-Module cmdlet is the preferred installation method for MS Graph PowerShell modules. Open the PowerShell as administrator and run the below commands to install the Microsoft Graph PowerShell module.
Run the below command to install the v1 module of the SDK in PowerShell Core or Windows PowerShell.
Install-Module Microsoft.Graph -Scope CurrentUser -Repository PSGallery -ForceRun the below command to install the Microsoft.Graph v1 module for All Users scope.
Install-Module Microsoft.Graph -Scope AllUsers -Repository PSGallery -Force
Step 4: Verify Graph PowerShell Module Installation
After the installation is completed, you can verify the installed version of Graph PowerShell with the following command.
Get-InstalledModule Microsoft.GraphIn the below image, we see the installed version of Microsoft.Graph module is 2.31.0. The version in the output should match the latest version published on the PowerShell Gallery.

Connect to Microsoft Graph PowerShell
Now I will show you how to use Connect-MgGraph which is a PowerShell cmdlet within the Microsoft Graph PowerShell SDK used to establish an authenticated session with Microsoft Graph.
Microsoft Graph PowerShell supports two types of authentications: delegated and app-only access. Various cmdlets are available to manage the essential parameters needed for authentication, such as environment, application ID, and certificate.
Below, I have shown the easy way to connect to Graph PowerShell while a detailed explanation of other connection methods will be covered in a separate post.
Run the below command to connect to Microsoft Graph using the interactive authentication, where you specify the permissions (scopes) needed for your session.
Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All"Upon running the above command, you must sign in with your credentials and complete the authentication.

After successful authentication, Microsoft Graph Command Line Tools will prompt you to grant consent on behalf of your organization. Review the required app permissions carefully and click “Accept.”

Installing Beta Module of Microsoft.Graph PowerShell
This is an optional step. To install the beta module of Microsoft.Graph PS, run the following command.
Install-Module Microsoft.Graph.Beta -Repository PSGallery -ForceUpdate Microsoft Graph PowerShell SDK Modules
You can update the Microsoft Graph PowerShell SDK and all of its dependencies using the following command.
Update-Module Microsoft.GraphIf you’re already running the latest version of Microsoft Graph PowerShell SDK, the command will run and return no output indicating that no updates are needed.

Disconnect Microsoft Graph
After completing your tasks with Microsoft Graph, ensure you disconnect by using the Disconnect-MgGraph cmdlet.
Run the below PowerShell command to sign out and completely disconnect Microsoft Graph.
Disconnect-MgGraphUninstall Microsoft Graph PowerShell SDK
If you want to remove all the installed versions of Microsoft Graph PowerShell SDK, run the below command in PowerShell.
Uninstall-Module Microsoft.Graph -AllVersionsNext, to remove all of the Microsoft.Graph dependency modules, run the following commands.
Get-InstalledModule Microsoft.Graph.* | ? Name -ne "Microsoft.Graph.Authentication" | Uninstall-Module -AllVersions
Uninstall-Module Microsoft.Graph.Authentication -AllVersionsConclusion
I hope with this guide, I’ve made it easier for you to install the Microsoft Graph PowerShell module. The Microsoft Graph PowerShell module is an API wrapper for the Microsoft Graph API and is a powerful tool for managing Microsoft 365 services. Whether you’re automating administrative tasks, managing users and groups, or retrieving reports, this module provides a convenient and efficient way to interact with the Microsoft Graph API using PowerShell.
If you have any questions, please let me know in the comments section below.




How to deploy it offline