Skip to content

Commit 4410552

Browse files
authored
Merge pull request MicrosoftDocs#1938 from kilasuit/patch-2
updated wording and formatting
2 parents 0a77832 + 8c8a5c9 commit 4410552

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
@@ -242,11 +242,18 @@ Connect-PnPOnline -Url <String>
242242
## DESCRIPTION
243243
If no credentials have been specified, and the CurrentCredentials parameter has not been specified, you will be prompted for credentials.
244244

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:
245+
*For SharePoint Online*: If legacy authentication protocols have been disabled the connection attempt will fail with a message such as the following or when using the default options, which prompts for a username and password within the shell:
246246

247247
>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.
248248
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.
249+
You can determine whether the SharePoint Online Tenant has disabled legacy authentication methods by running the following powershell snippet
250+
`
251+
(Get-PnPTenant).LegacyAuthProtocolsEnabled
252+
`
253+
and if this returns False, then legacy authentication methods have been disabled on the tenant that you are connecting to.
254+
255+
This will then instead mean that you need to ensure that you specify the appropriate options that support modern authentication, such as connections with the "-UseWebLogin" or "-PnPO365ManagementShell" parameters or certificate based authentication.
256+
250257

251258
## EXAMPLES
252259

0 commit comments

Comments
 (0)