5

I'm trying to connect to a SPO tenant using PowerShell, using MS documentation here: https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-online/connect-sharepoint-online?view=sharepoint-ps

But it appears that it is only possible to connect using an account which is an admin in the given tenant.

Is there a way to assign permission to an ordinary user account, so it can connect to SPO through PowerShell?

My intention is to manipulate certain sites through PowerShell, but it is not possible for me to use the tenant admin account for it.

2 Answers 2

5

No, you can't use the non-admin account, as SPO powershell always run under the tenant-admin account. You have to have a tenant admin account and connect to https://tname-admin.sharepoint.com

I think in your scenario, use the PNP for SharePoint online. Which is run under the site collection scope so it will help you to achieve the required goal.

https://github.com/SharePoint/PnP-PowerShell

0
0
  • The new version of PNP PowerShell requires Windows PowerShell version >=7. In order to install it use for example:

    winget install --id Microsoft.Powershell --source winget

  • Then open Windows PowerShell 7 and run following command to install PnP Power shell:

    Install-Module PnP.PowerShell -Scope CurrentUser

  • For Login to a site use

    Connect-PnPOnline –Url https://{tentant}.sharepoint.com/sites/{site_name} –Credentials (Get-Credential)

    and specify eMail address and password.

Also see https://collab365.com/perform-simple-crud-operations-sharepoint-pnp/

  • Example command to create a new list "Fruits":

    New-PnPList -Title "Fruits" -Template GenericList

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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