Introduction
If you have installed the MS Graph PowerShell module for the very first time, you may need to have the Global Admin for your tenant, and have consented to MS Graph PowerShell module. At the backend, Azure AD provides an Enterprise Application called Microsoft Graph PowerShell. The permission for this app needs to be consented by your admin before you start interacting with this PS module. More about the Graph PowerShell and the installation of the Graph PowerShell module can be found in the references section.
Below is the screen capture from the Azure AD Enterprise applications for Graph PowerShell Module.

In this article, let’s try to understand basic identity flows involved in Graph PowerShell module. Below is the Authorization Code Grant Flow for the Graph PowerShell module.

Below are the steps in brief that occur between User, Admin, and the Graph PowerShell module.
- User tries to interact with Graph PowerShell module by running the command connect-MgGraph
- At first, the user is taken to Oauth2.0 client login.
- After authentication, the Graph PowerShell module checks for user permissions.
- If the permissions are not defined, it asks for the user/admin consent based on the scope of operations.
- Once the admin consent is granted, user is provided with an Access token to interact with.
Interacting with Graph PowerShell Module
After installing if you try running below command for connecting to Graph PowerShell module, you would be asked for approval.
Connect-MgGraph

If the setup is completed successfully, you should see below login pop-up.

For certain modules, it is required to have Global Admin consent before you start using this app. For instance, after setting up the Graph module, you cannot connect to graph module, before it will give the below message.








Join the conversation! Your thoughts help the community grow.