Skip to content

Latest commit

 

History

History
96 lines (71 loc) · 2.26 KB

Connect-PnPMicrosoftGraph.md

File metadata and controls

96 lines (71 loc) · 2.26 KB
external help file applicable schema
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online
2.0.0

Connect-PnPMicrosoftGraph

SYNOPSIS

Connect to the Microsoft Graph

SYNTAX

Scope

Connect-PnPMicrosoftGraph -Scopes <String[]>

AAD

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------------------

PS:> 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------------------

PS:> 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 registred. Eg.: contoso.com, or contoso.onmicrosoft.com.

Type: String
Parameter Sets: AAD

Required: True
Position: Named
Accept pipeline input: False

-AppId

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

Type: String
Parameter Sets: AAD

Required: True
Position: Named
Accept pipeline input: False

-AppSecret

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

Type: String
Parameter Sets: AAD

Required: True
Position: Named
Accept pipeline input: False

-Scopes

The array of permission scopes for the Microsoft Graph API.

Type: String[]
Parameter Sets: Scope

Required: True
Position: Named
Accept pipeline input: False

RELATED LINKS

SharePoint Developer Patterns and Practices