Skip to content

Commit 5787281

Browse files
authored
Merge pull request MicrosoftDocs#1521 from bspender/patch-1
Doc changes to make modern authentication easier
2 parents 1e99530 + d08bcf5 commit 5787281

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

sharepoint/sharepoint-ps/sharepoint-pnp/Connect-PnPOnline.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ external help file:
33
applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Online
44
schema: 2.0.0
55
---
6+
67
# Connect-PnPOnline
78

89
## SYNOPSIS
@@ -60,7 +61,7 @@ Connect-PnPOnline -Scopes <String[]>
6061
[-NoTelemetry [<SwitchParameter>]]
6162
```
6263

63-
### WebLogin
64+
### WebLogin
6465
```powershell
6566
Connect-PnPOnline -Url <String>
6667
-UseWebLogin [<SwitchParameter>]
@@ -241,6 +242,12 @@ Connect-PnPOnline -Url <String>
241242
## DESCRIPTION
242243
If no credentials have been specified, and the CurrentCredentials parameter has not been specified, you will be prompted for credentials.
243244

245+
*For SharePoint Online*: If legacy authentication protocols have been disabled (i.e. When `powershell(Get-PnPTenant).LegacyAuthProtocolsEnabled` returns False), the connection attempt will fail with a message such as the following when using a generic credential object (such as that created by `powershellGet-Credential`) or when using the default options, which prompts for a username and password within the shell:
246+
247+
>Failed to connect to (site), Exception calling "ExecuteQuery" with "0" argument(s): "Cannot contact web site (site) or the web site does not support SharePoint Online credentials. The response status code is 'Unauthorized'. The response headers are 'X-SharePointHealthScore=0, X-MSDAVEXT_Error=917656; Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically.
248+
249+
Instead, ensure that you specify the appropriate options that support modern authentication, such as connections with the "-UseWebLogin" or "-PnPO365ManagementShell" parameters or certificate based authentication.
250+
244251
## EXAMPLES
245252

246253
### ------------------EXAMPLE 1------------------
@@ -920,4 +927,4 @@ Accept pipeline input: False
920927
921928
## RELATED LINKS
922929
923-
[SharePoint Developer Patterns and Practices](http://aka.ms/sppnp)
930+
[SharePoint Developer Patterns and Practices](http://aka.ms/sppnp)

0 commit comments

Comments
 (0)