【发布时间】:2021-05-20 04:23:40
【问题描述】:
我正在尝试使用下面的脚本设置我的租户站点的 DenyAddAndCustomizePages 属性,但它给出了错误。将它与新的 PnP.Powershell 模块一起使用应该是什么替代方案?我们的项目使用 SharepointPnPPowershell 运行了几个月,但在安装 PnP 后,现在已弃用且不再支持此功能。 Powershell 我们发现了很多问题。
方法调用失败,因为 [PnP.PowerShell.Commands.Model.SPOSite] 不包含名为“update”的方法。
我尝试包含 Import-Module Microsoft.Online.SharePoint.PowerShell -Scope "Local",如下文末尾所述,但这不起作用. https://docs.microsoft.com/en-us/answers/questions/258967/problems-with-update-method-to-change-conditional.html
$site = Get-PnPTenantSite -Detailed -Url $Url
$site.DenyAddAndCustomizePages = "Disabled"
$site.Update() | Out-Null
【问题讨论】:
-
我们可以按照下面文章中的答案同时安装 PnP.Powershell 和 SharePointPnPPowerShellOnline 模块吗?docs.microsoft.com/en-us/answers/questions/258967/…
标签: powershell sharepoint-online