0
votes

To start, I am using Windows 7, I am a full adminstrator on this machine I have tried other machines and ran as an administrator as well

I am only a sharepoint site collection admin

In powershell we connect to Sharepoint online. during this process, if I use Connect-PnPOnline -Url $masterSiteUrl -useweblogin, I get prompted for a username, however the next screen is blank and stays there.

when I do a view source of that page I get d>Redirecting....myshn.net/certcheck" method="POST">

I do have scripting enabled and sometimes I get a certificate issue, I have clicked "Install Certificate" although I am not sure what it did, but it still doesnt work Ive also tried -SPOManagementShell and -ClearTokenCache and get the following error Connect-PnPOnline : Parameter set cannot be resolved using the specified named parameters. At line:1 char:1 + Connect-PnPOnline -Url $masterSiteUrl -useweblogin -spoManagementShel ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Connect-PnPOnline], ParameterBindingException + FullyQualifiedErrorId : AmbiguousParameterSet,SharePointPnP.PowerShell.Commands.Base.ConnectOnline

1
This is an Azure/O365 auth issue, not a PowerShell specific one. Connecting to O365 resources has nothing to do with your on-Prem AD or AD user account or what OS you are using. It has to do with your Azure and SPO identity and permissions. If you go directly to SPO, via the Azure portal, how are you logging in? You need to be properly configured. See the docs on that topic. - postanote
When I go to the azure site it logs me in automatically with my AD company account, no password needed, I just enter my email - Roger i
This just means that they have eSSO enabled in Azure Portal via your internal IdP but you had to hit a login page to pass creds (which takes your creds, passes the request to AAD, then this passes this to your IdP, verifies you and allows you in). This is not the same thing when connecting with PowerShell. You are n ot going through a login page, thus the eSSO not being a thing. You must pass explicit credentials in your connection request to Azure/O365 when using automation. See teh MS docs for logging into Azure/O365 using PowerShell. - postanote
when logging in with powershell, I have tried the following Username = email and password = ADPassword Username = email, password = CompanyName username = email, password ="" - Roger i

1 Answers

0
votes

See this:

Connect to all Office 365 services in a single Windows PowerShell

and this...

Connect to all Office 365 Services PowerShell - Supports MFA too

Using our All-in-One PowerShell script, you can connect to all Office 365 Services using a single cmdlet. It supports both MFA and non-MFA account -Exchange Online -Azure AD -SharePoint Online -Skype for Business Online -Security & Compliance Center -Teams

Download: ConnectO365Services.ps1

O365_Logon 1.1

O365 logon cmdlets to assist IT administrators. In this module, there are several cmdlets that simplify the process of logging onto various O365 components.