Have you ever heard of Microsoft Graph? If you are an experienced IT Professional or Microsoft certified administrator this should sound familiar to you. Though, even if you are not so well-known MS product but as long as you are using products like Teams and other Microsoft 365 services, you’re using Microsoft Graph.
In the post I’ll demonstrate how to install the PowerShell module for Microsoft Graph.
What exactly is Microsoft Graph?
Simply put, Microsoft Graph is an Application Programming Interface (API) that provides developers with a unified way to access a wide range of data and services across Microsoft 365, Windows, and other Microsoft cloud services. With Microsoft Graph, developers can build applications that integrate with Microsoft services and leverage data and capabilities they offer. Developers can get started with Microsoft Graph quickly and access data across an organization without having to learn about how individual Microsoft 365 services work.

Okay, but I am just an IT professional, do I need to know this?
Yes, even though you’re not a developer you can still leverage basic knowledge of Microsoft Graph with their PowerShell module to perform certain administrative tasks.
One of the greatest example is that you can manipulate LAPS (Local Administration Password Solution) with Microsoft Graph PowerShell module (a.k.a. Microsoft Graph PowerShell library or Microsoft Graph PowerShell SDK).
How can I install Microsoft Graph PowerShell module?
The prerequisite is pretty simple for majority of Windows devices:
- PowerShell version 5.1 or later (PowerShell 7 and later is the recommended PowerShell version for use with the Microsoft Graph PowerShell SDK on all platforms).
- Installed .NET Framework 4.7.2 or later
- The PowerShell script execution policy set to “RemoteSigned” or “Less restrictive”.
Once you checked that your device it meets above prerequisite then you can proceed with the following steps:
1.Open PowerShell with admin rights > enter “Get-ExecutionPolicy” to check PowerShell script execution policy on current machine.

2.If was set to “Restricted” then proceed set to “RemoteSigned” by enter “Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser” > press enter.

3.Enter “Install-Module Microsoft.Graph -Scope CurrentUser” > press enter > “Y”.

Waiting for at least 5mins or 10mins depending on your current network conditions. It will install all 38 submodules so will take a bit longer.



How to verify the installation?
After the installation is completed, you can verify the installation by enter “Get-InstalledModule Microsoft.Graph”.

To verify the installed sub-modules and their version, you can run “Get-InstalledModule”.

Or you can enter “connect-MgGraph -TenantIDxxxx” to verify. If you saw the prompt for sign-in then the module was installed correcly.

How to update the module?
To update the module and all of its dependencies using the following command “Update-Module Microsoft.Graph”

How to uninstall the module?
You can enter “Uninstall-Module Microsoft.Graph” to uninstall the main module.

To remove all of the dependency modules running the commands “Get-InstalledModule Microsoft.Graph.* | %{ if($_.Name -ne “Microsoft.Graph.Authentication”){ Uninstall-Module $_.Name } }
Uninstall-Module Microsoft.Graph.Authentication”.

Reference
Microsoft Graph Dev Center | APIs and app development
Microsoft Graph overview – Microsoft Graph | Microsoft Learn
Install the Microsoft Graph PowerShell SDK | Microsoft Learn