How to connect to Microsoft GraphAPI with PowerShell
Using a credentials file to connect to the GraphAPI
Using the GraphAPI we can query data from just about any of the Microsoft 365 products. So if we need to get a list of users or a list of devices in InTune this can all be done with Graph. However, it’s a bit different from getting data from the console or from PowerShell and has been difficult to automate in the past because we need to get an authentication token. Thankfully Microsoft has created a set of example scripts to authenticate and run queries.