0

So I'm using tutorial from here : https://technet.microsoft.com/en-us/library/fp161372.aspx

But when I tried to connect, there is an error as above. I have set my credential as global administrator. I also checked on my O365 admin -> user, my account registered as global administrator. So why am I still unauthorized to access my SPO using SPO Management Shell?

Below are my code based on tutorial from msdn

$adminUPN="intanpuspita@my365trial.onmicrosoft.com"
$orgName="my365trial"
$userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
Connect-SPOService -Url http://$orgName-admin.sharepoint.com -Credential $userCredential
  • could you please share the your commands, how you trying to connect? – Waqas Sarwar MVP Aug 29 '16 at 2:50
  • and which site you trying to connect? – Waqas Sarwar MVP Aug 29 '16 at 2:53
  • @WaqasSarwarMCSE yup i already added the code in my questions – Intan Aug 29 '16 at 2:56
  • i see your Admin site url is Http...is it typo? also instead of using the $orgname just type directly url – Waqas Sarwar MVP Aug 29 '16 at 2:59
  • @WaqasSarwarMCSE No its not a typo. I'm just following the instruction in link above, and if i remove the Http it will give me another error. And also I tried to type my url directly, but it still give me unauthorized error – Intan Aug 29 '16 at 3:05
0

from your command looks like you are trying to connect using the http url. In SPO, I believe it is always https.Please use the below script( with https).

$adminUPN="intanpuspita@my365trial.onmicrosoft.com"
$orgName="my365trial"
$userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
Connect-SPOService -Url **httpS://**$orgName-admin.sharepoint.com -Credential $userCredential

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.