Connect-PnPMicrosoftGraph

Connect to the Microsoft Graph

Syntax

Connect-PnPMicrosoftGraph
       -Scopes <String[]>
Connect-PnPMicrosoftGraph
       -AppId <String>
                                -AppSecret <String>
                                -AADDomain <String>

Description

Uses the Microsoft Authentication Library (Preview) to connect to Azure AD and to get an OAuth 2.0 Access Token to consume the Microsoft Graph API

Examples

------------------EXAMPLE 1------------------

Connect-PnPMicrosoftGraph -Scopes $arrayOfScopes

Connects to Azure AD and gets and OAuth 2.0 Access Token to consume the Microsoft Graph API including the declared permission scopes. The available permission scopes are defined at the following URL: https://graph.microsoft.io/en-us/docs/authorization/permission_scopes

------------------EXAMPLE 2------------------

Connect-PnPMicrosoftGraph -AppId '<id>' -AppSecret '<secret>' -AADDomain 'contoso.onmicrosoft.com'

Connects to the Microsoft Graph API using application permissions via an app's declared permission scopes. See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/Graph.ConnectUsingAppPermissions for a sample on how to get started.

Parameters

-AADDomain

The AAD where the O365 app is registered. Eg.: contoso.com, or contoso.onmicrosoft.com.

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-AppId

The client id of the app which gives you access to the Microsoft Graph API.

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-AppSecret

The app key of the app which gives you access to the Microsoft Graph API.

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Scopes

The array of permission scopes for the Microsoft Graph API.

Type:String[]
Position:Named
Accept pipeline input:False
Accept wildcard characters:False