【问题标题】:Error while setting the DenyAddAndCustomizePages property of tenant site using PnP Powershell使用 PnP Powershell 设置租户站点的 DenyAddAndCustomizePages 属性时出错
【发布时间】: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

【问题讨论】:

标签: powershell sharepoint-online


【解决方案1】:

我猜你现在找到了答案?如果没有,你试过吗?

Set-PnpTenantSite -Identity $siteUrl -DenyAddAndCustomizePages:$false | Out-Null

Tks.

亚历克斯

【讨论】:

    猜你喜欢
    • 2020-08-02
    • 2023-02-06
    • 2019-06-10
    • 2020-05-31
    • 2016-04-20
    • 2011-07-31
    • 2021-12-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多