使用 Powershell 连接 Sharepoint Online

Connecting Sharepoint Online using Powershell

我是 Powershell 的新手,正在尝试学习它并从头开始。 我的任务是从 Sharepoint Online 检索一些信息,我应该使用 Powershell 来完成,但是每当我尝试 运行 cmdlet Install-Module SharePointPnPPowerShellOnline 我得到以下错误。

Install-Module:需要管理员权限才能在 'C:\Program Files\WindowsPowerShell\Modules' 中安装模块。 使用具有管理员权限的帐户登录计算机,然后重试,或安装

是不是我没有全局管理员权限?

您需要本地计算机的本地管理员权限,这与 Sharepoint 或 PowerShell 无关。 如果您拥有这些权限,请右键单击 PowerShell 可执行文件并选择 运行 作为管理员。

如果您没有本地系统的管理员权限,您可以尝试使用:

-Scope CurrentUser

https://docs.microsoft.com/en-us/powershell/module/powershellget/install-module?view=powershell-7#example-5--install-a-module-only-for-the-current-user