好的,我尝试将 PnP 配置模板部署到网站集。我遇到了以下错误,到目前为止还没有运气。这是我的命令和日志的更详细的帖子。
> Connect-PnPOnline -Url "site collection"
> Apply-PnPProvisioningTemplate -Path "template.xml"
WARNING: List Graphics (Graphics, ####) exists but is of a different type. Skipping
list.
Apply-PnPProvisioningTemplate : Object reference not set to an instance of an object.
At line:1 char:1
+ Apply-PnPProvisioningTemplate -Path "Template.xml" -Exclude ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Apply-PnPProvisioningTemplate], NullReferenceException
+ FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Provisioning.Site.ApplyProvisioningTemplate
在此之后,我在另一个用户的推荐下启动了一个日志文件。在该日志文件中,我遇到了一些错误。
set-pnptracelog -on -logfile traceoutput.txt
powershell.exe Warning: 0 : 2020-08-26 10:53:49.9215 [Site Security] [16] [Information] Failed to EnsureUser c:0o.c|federateddirectoryclaimprovider|##### 4715ms ######
powershell.exe Error: 0 : 2020-08-26 10:53:51.1575 [OfficeDevPnP.Core] [0] [Error] ExecuteQuery threw following exception: Microsoft.SharePoint.Client.ServerException: The specified user c:0o.c|federateddirectoryclaimprovider| ##### could not be found.
Server Details:
powershell.exe Error: 0 : 2020-08-26 10:54:50.2331 [List instances] [16] [Error] Error during webhook add/update: AADSTS65001: The user or administrator has not consented to use the application with ID '#####' named 'PnP Management Shell'. Send an interactive authorization request for this user and resource.
在此处运行此另一个用户后,我建议我运行 pnp 配置模板,同时排除安全处理程序。这也不起作用。
Apply-PnPProvisioningTemplate -Path "Template.xml" -ExcludeHandlers SiteSecurity
注意:运行最新版本的 SharePointPnPPowerShellOnlien 3.24.2008.1