💻

SharePoint Online のコミュニケーション サイトで評価の設定を有効にする

2022/01/01に公開

SharePoint Online のコミュニケーション サイトでは、リストの設定 にある 評価の設定 の項目がありません。そのため いいね!星評価 の機能を使うことができないようになっています。

評価の機能は GUI からは設定できませんが、CSOM から機能を有効化することで利用できるようになります。

Add-Type -LiteralPath "$PSScriptRoot\Microsoft.SharePoint.Client.dll"
Add-Type -LiteralPath "$PSScriptRoot\Microsoft.SharePoint.Client.Runtime.dll"

$siteurl = "{{site-url}}"
$username = "{{user-name}}"
$password = "{{password}}"

$password = ConvertTo-SecureString $password -AsPlainText -Force
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
$context = New-Object Microsoft.SharePoint.Client.ClientContext($siteurl)
$context.Credentials = $credentials

$context.Site.Features.Add("915c240e-a6cc-49b8-8b2c-0bff8b553ed3", $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None) > $null
$context.ExecuteQuery()

Discussion