What role is required to be able to run Poweshell script in SharePoint online?
SharePoint Admin? or Global Admin?
What role is required to be able to run Poweshell script in SharePoint online?
SharePoint Admin? or Global Admin?
The SPO cmdlets require the SharePoint Admin role (or Global Admin). PnP cmdlets require permission based on the scope of the cmdlet; this could be as little as Read or Member access to a particular site. Some PnP cmdlets require the SPO Admin role, but those are the PnP tenant cmdlets.
You should use https://www.powershellgallery.com/packages/PnP.PowerShell as the other module you listed is no longer under development.
Hi @YiruChen-1261,
The cmdlet Install-Module SharePointPnPPowerShellOnline need to be ran as a local administrator to install the PnP PowerShell module.
After installing the PnP PowerShell module, as trevor said, PnP cmdlets require permission based on the scope of the cmdlet.
Usually, you could use site member account to access your site with the cmdlet: Connect-PnPOnline -Url https://tenant.sharepoint.com/sites/test
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.
Which cmdlet in particular? Generally speaking you need to be a SPO admin, some functionality might require a different role though.
6 people are following this question.