question

RS-5762 avatar image
0 Votes"
RS-5762 asked MichaelHan-MSFT answered

Unable to connect to my dev SPO admin with PowerShell

Hi All,
Just new user at MS Dev Center and got stuck..

I created my Dev tenant and a sample SPO site.
I can log in via browser to all.

I'm trying to run a PS script (provided from MS), which basically creates a SPO collaboration site, created a group for it etc, but I cannot connect to the tenant when the script tries to Connect to SPOService:

 try{
  $cred = Get-Credential $adminaccount
  Connect-SPOService -Url $adminSiteUrl -Credential $cred
  }
  catch{
  Write-Host $_
  Write-Host "Failed at Connect-SPOService, make sure your sign-in details are correct."
  exit
  }

I am using the same creds as when login via browser and I'm sure i enter them correctly as I copy/paste to avoid mistake...

Attached is the error.

99972-2021-05-26-18-22-50-select-administrator-windows-p.png

Any ideas, pls as i'm stuck


office-sharepoint-onlinewindows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MichaelHan-MSFT avatar image
0 Votes"
MichaelHan-MSFT answered

Hi @RS-5762,

Frome the error, looks like the sign-in name or password is not correct. Please make sure that you use the correct account and password.

Besides, if you try the below to Connect-SPOService, check if it works for you:


 Connect-SPOService -Url https://YourTenant-admin.sharepoint.com


If an Answer is helpful, please click "Accept Answer" and upvote it.
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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.