Install PowerShell SDK for Microsoft Intune Graph API

Microsoft is deprecating the Azure AD Powershell Module and MS Online module in 2022. So, admin need to migrate to either PowerShell SDK for Microsoft Intune Graph API or Microsoft Graph API.

Let’s see how we can install PowerShell SDK for Microsoft Intune Graph API from PowerShell Gallery.

To install PowerShell module for Intune Graph API, open PowerShell with admin privilege’s and run below command.

Install-Module -Name Microsoft.Graph.Intune

Once you have installed it, you can verify the installation using below command.

Get-InstalledModule -name Microsoft.Graph.Intune

PowerShell Get-InstalledModule Intune Graph API

Now you need to connect with MSGraph using admin consent. The admin consent is required for first time connect only.

Connect-MSGraph -AdminConsent

This will ask for permission similar to any other Graph/ REST application when you connect to O365.

Connect_MSGraph Sign-in Prompt

MSGraph - Intune - Admin Consent

For subsequent usage, you can simply Connect-MSGraph without any parameters


Once connected, you will see the user name and Tenant ID you connected with.

Connect-MSGraph Intune

Now you can run the commands which are available such as list of all managed devices can be retrieved using Get-IntuneManagedDevice command.


Related Posts

  • Get AAD Group Members Details Using PowerShell SDK for Microsoft Intune Graph API
  • How To Export Serial number of Multiple Devices using PowerShell SDK for Intune Graph API

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top