Forum Discussion
Joe Fedorowicz
Sep 23, 2016Iron Contributor
Trying to use PowerShell for SharePoint Online, failing miserably
Hey, I'm usually good enough to feel my way through any problem I might have, but I have hit a stopping point with PowerShell. Every time I try to pull data or execute anything, I get an "Unau...
Dean_Gross
Sep 23, 2016Silver Contributor
Are you a Global Tenant admin?
Are you using the latest update to the SPO Management Shell?
Are you using the PnP Powershell cmdlets? https://github.com/OfficeDev/PnP-PowerShell, if so, you can just use the Get-SPOList cmdlet, see https://github.com/OfficeDev/PnP-PowerShell/blob/master/Documentation/GetSPOList.md. If you are not using these, you should, they are awesome.
Joe Fedorowicz
Sep 23, 2016Iron Contributor
Hey,
Thanks for helping out.
1) I am a global tenant admin.
2) I am, at least according to the download page.
I want to use PnP, even though it wont do what I need done by default (editing the "required" value of a content type column). However, when I try to use Connect-SPOnline, I get the below error:
Connect-SPOnline : Cannot contact web site 'https://harmelinmedia.sharepoint.com/' or the web site does not support SharePoint Online credentials. The response status code is 'Unauthorized'. The response headers are 'X-SharePointHealthScore=0, SPRequestGuid=589ea69d-30b4-2000-15bb-d994b5063a31, request-id=589ea69d-30b4-2000-15bb-d994b5063a31, X-MSDAVEXT_Error=917656; Access+denied.+Before+opening+files+in+this+l ocation%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically., MicrosoftSharePointTeamServices=16.0.0.5715, X-Content-Type-Options=nosniff, X-MS-InvokeApp=1; RequireReadOnly, Content-Length=0, Content-Type=text/plain; charset=utf-8, Date=Fri, 23 Sep 2016 15:45:04 GMT, P3P=CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI", Server=Microsoft-IIS/8.5, X-Powered-By=ASP.NET'. At line:1 char:1 + Connect-SPOnline -Url https://harmelinmedia.sharepoint.com/ -Credenti ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Connect-SPOnline], NotSupportedException + FullyQualifiedErrorId : System.NotSupportedException,SharePointPnP.PowerShell.Commands.Base.ConnectSPOnline
- Dean_GrossSep 23, 2016Silver ContributorThat looks like a problem with your credentials, double check your values against the instructions in the Getting Started section of https://github.com/OfficeDev/PnP-PowerShell.
If you have MFA, you need to use the UseWebLogin parameter in the connect-sponline statement- Joe FedorowiczSep 23, 2016Iron ContributorI don't use MFA and I put it in as written by the "Getting Started" section.
- Joe FedorowiczSep 23, 2016Iron ContributorWait, is MFA modern or multi-factor (or are they the same thing?)