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
Now you need to connect with MSGraph using admin consent. The admin consent is required for first time connect only.
This will ask for permission similar to any other Graph/ REST application when you connect to O365.
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.
Now you can run the commands which are available such as list of all managed devices can be retrieved using Get-IntuneManagedDevice command.
- 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