English 中文(简体)
采用PnP PowerShell模块和“无障碍”
原标题:Login to SharePoint using PnP PowerShell Module and an Access Token

这是我在这里在社区这里的第一个问题!

I m试图利用PnP PowerShell模块连接一个共享点,并进入象征性点,但Im仍然无法工作。

文字如下:

# Import the MSAL Module to generate the access token
Import-Module MSAL.PS

# Generating the token (this brings other fields too, like  ExpireOn  or  TokenType )
$token1 = Get-MsalToken -ClientId xxx -ClientSecret $(convertto-securestring("xxx") -AsPlainText -Force) -TenantId xxx

# Saving only the  Access Token  field value into the variable
$token1 = $token1.AccessToken

# Trying to connect using the token
connect-pnpOnline -Url "https://boehringerdev.sharepoint.com/sites/z365SupportSite" -AccessToken $token1

错误如下:

Connect-PnPOnline: Could not load file or assembly  Microsoft.Identity.Client, Version=4.50.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae . Could not find or load a specific file. (0x80131621)

我也试图用以下几厘米的圆顶把脚灯改成安全探测器:

$secureToken = ConvertTo-SecureString $token1 -AsPlainText –Force

但是,当我试图使用安全的Token时,我也遇到同样的错误。

谁能帮助我? DV!

I m 试图通过照相机和Im 连接一个共享点(Dev Tenant)的同一错误。

问题回答

这一错误发生在PnP.PowerShell模块与Microsoft不相容时。 身份认同。 为了纠正这一错误,你可以尝试公布最新版本,并安装以前的PnP.PowerShell模块。 你可以通过在威斯特尔指挥以下行动:

Install-Module PnP.PowerShell -RequiredVersion 1.12 -Force

在安装前版本后,请设法再次使用联通-PnPOnline指挥系统,并检查是否存在问题。





相关问题
SharePoint - Approaching Website Storage Limit Email

How can i go about changing the distribution list as well as the email text for the email that goes out to site collection admin when a site collection approaches it s size limit? Thanks for your ...

UI automated testing within SharePoint

I m looking for automated Functional Testing tools that can manipulate SharePoint sites, libraries, and documents thought the web interface. It needs to be extensible enough to handle any custom ...

Enable authorization on sitemap provider

I want to enable Authorization on the Site map provider. We have enabled anonymous access to the site and we want the Site map provider to be visible only to authorized users. I tried ...

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

Sharepoint 2007 Data view Webpart custom parameters

I m sort of new to the custom parameters that can be setup on a DataView Webpart. There are 6 options: - None - Control - Cookie - Form - QueryString - Server Variable I think that None, Cookie and ...

热门标签