I've used PnP a fair amount in the past when working with SharePoint Online, I'm now using it against a SharePoint 2016 on-prem environment. However, I'm having trouble getting connected.
The SP2016 farm sits behind ADFS...
When trying to connect, i'm using the following:
Connect-PnpOnline -Url https://collab.myCorp.com -Credentials 'O365Creds' -UseAdfs
I'm using the latest PnP modules, and storing my username and pwd in the credential manager.
The error I'm seeing is:
Connect-PnpOnline : Exception has been thrown by the target of an invocation.
At line:2 char:1
+ Connect-PnpOnline -Url https://coll.myCorp.com -Credentials ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Connect-PnPOnline], TargetInvocationException
+ FullyQualifiedErrorId : System.Reflection.TargetInvocationException,SharePointPnP.PowerShell.Commands.Base.ConnectOnline
If I don't use the -adfs flag (as a test) I see the following error:
Connect-PnpOnline : Cannot contact web site 'https://collab.myCorp.com/' or the web site does not support SharePoint Online credentials. The response status code is
'Forbidden'. The response headers are 'X-SharePointHealthScore=0, SPRequestGuid=c3bf519e-994e-2020-90f3-0c6fe9776187, request-id=c3bf519e-994e-2020-90f3-0c6fe9776187,
X-Forms_Based_Auth_Required=https://collab.myCorp.com/_trust/?ReturnUrl=/_layouts/15/error.aspx,
X-Forms_Based_Auth_Return_Url=https://collab.myCorp.com/_layouts/15/error.aspx, 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.,
MicrosoftSharePointTeamServices=16.0.0.4480, X-Content-Type-Options=nosniff, X-MS-InvokeApp=1; RequireReadOnly, Content-Length=13, Content-Type=text/plain; charset=utf-8,
Date=Fri, 09 Mar 2018 08:10:07 GMT, Server=Microsoft-IIS/8.5, X-Powered-By=ASP.NET'.
Any ideas? Surely what I'm trying to do is pretty basic..
Thanks