Once it has been run you can run commands like:
as shown above.
To allow this script to operate correctly you’ll need the following two modules installed:
When intune-connect.ps1 runs you’ll be prompted for your credentials as normal.
Then you password and MFA if required.
Because connection to Intune via PowerShell now uses the Microsoft Graph, you’ll need to allow the above permissions as shown once.
You’ll find those permissions, when you accepted them, in Azure AD, User, Applications as shown above inside the Azure portal. In there will be an application called Microsoft Intune PowerShell as shown above.
If you select that Microsoft Intune PowerShell and scroll down to the bottom of the screen that is displayed, you can select a link View granted permissions as shown above.
You will then see all the permission granted to that user for accessing the Graph. You can also remove these if you ever want to as well here.
Having access to Intune and Autopilot via PowerShell will make automating device management much easier.