
Import-Module Microsoft.Online.SharePoint.PowerShell -UseWindowsPowerShell
Connect-SPOService -url https://***-admin.sharepoint.com
(DO NOT USE "-Credential")
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
How to fix the issue to connect to SharePoint Online using PowerShell like below?
Because when I am using the PowerShell ISE, and then the command:
Connect-SPOService -Url 'https://CompanyName-admin.sharepoint.com'
I got the error:
Connect-SPOService : No valid OAuth 2.0 authentication session exists At line:1 char:1
Thank you.
Import-Module Microsoft.Online.SharePoint.PowerShell -UseWindowsPowerShell
Connect-SPOService -url https://***-admin.sharepoint.com
(DO NOT USE "-Credential")
2024 and the module still does not support browser authentication making it pretty much useless to companies that use FIDO2 keys...
Please check the URL Connect-SPOService only accept sharepoint Admin site URL not site collection URL.
Hi @EnterpriseArchitect ,
Per my test, we will get a windows to log in like following picture after call the cmdlet, and your browser doesn't support this function.
This error means you need to update your browser or download Edge as default browser. As a workaround, you can also use following cmdlet without log with a window. We can write the user account and secret into the cmdlet. Please make a reference
$username = "******@contoso.sharepoint.com"
$password = "password"
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(convertto-securestring $Password -asplaintext -force)
Connect-SPOService -Url https://contoso-admin.sharepoint.com -Credential $cred
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
After I set Microsoft Edge as default browser again, microsoft login window opened up as normal.
Thanks!