With the upcoming release of Microsoft Intune in the Azure portal, we’re finally getting support for automation. Microsoft states that everything that you can do through the Azure portal, is possible to accomplish with PowerShell as well. This becomes possible because Microsoft has built the new portal on top of what’s called Microsoft Graph API. If you were to add a new Device Profile, add an App or create a Compliance Policy, all the actions you take within the portal, is actually being processed by the Microsoft Graph API that communicates with the Microsoft Intune backend. With this knowledge in mind, it’s now possible to start exploring all the possibilities available through the Microsoft Graph API and how it can be used with PowerShell.
UPDATE: This post has been amended and now references the PSIntuneAuth module instead that simplifies the whole authentication process.
Sample script utilizing the authentication module