現象
Microsoft SharePoint Server の次の 10 月のセキュリティ更新プログラムをインストールした後、Microsoft SharePoint 2010 ワークフローシナリオの一部がブロックされる可能性があります。 さらに、"6ksbk" イベント タグは SharePoint 統合ログ システム (ULS) ログに記録されます。
-
SharePoint Foundation 2013 のセキュリティ更新プログラムの説明: 2022 年 10 月 11 日 (KB5002284)
-
SharePoint Enterprise Server 2016 のセキュリティ更新プログラムの説明: 2022 年 10 月 11 日 (KB5002287)
-
SharePoint Server 2019のセキュリティ更新プログラムの説明: 2022 年 10 月 11 日 (KB5002278)
-
SharePoint Server サブスクリプション エディションのセキュリティ更新プログラムの説明: 2022 年 10 月 11 日 (KB5002290)
原因
SharePoint ワークフローのセキュリティを強化するために、SharePoint ではワークフロー .xoml ファイルの UTF-8 文字エンコードのみがサポートされるようになりました。
注: SharePoint Designer、Microsoft Visual Studio、Nintex などの SharePoint ワークフロー ツールは、既定で UTF-8 文字エンコードを使用してワークフロー .xoml ファイルを作成します。 ワークフロー .xoml ファイルを手動で編集し、別の文字エンコードに変換していない限り、お客様はこのセキュリティ強化の影響を受けることはありません。 この問題は、お客様がこれを選択した可能性が非常に低い可能性について、このサポート技術情報の記事に記載されています。
回避策
ワークフロー .xoml ファイルを手動で編集し、UTF-8 以外の文字エンコードに変換した場合は、ファイルを再編集して UTF-8 に変換する必要があります。 ファイルの XML 宣言でエンコードが UTF-8 として定義されていることを確認し、ファイルをテキスト エディターで UTF-8 文字エンコード形式で保存してから、再デプロイします。
SharePoint 管理シェルで次の PowerShell スクリプトを使用すると、SharePoint サイト コレクション内のワークフロー .xoml ファイルをスキャンして、この変更の影響を受けるかどうかを判断できます。 IsGoodWorkflow 出力されるのはTrue、UTF-8 文字エンコーディングを使用し、この変更に対応したワークフロー .xoml ファイルです。 IsGoodWorkflow 出力されるのはFalse、UTF-8 文字エンコーディングを使用しておらず、修正が必要なワークフロー .xoml ファイルです。
<#
.SYNOPSIS
Script to check character encoding of workflow .xoml files found in a site collection.
.DESCRIPTION
This script checks the character encoding of workflow .xoml files found in a site collection based
on the security improvement documented here: https://support.microsoft.com/topic/sharepoint-2010-workflows-might-be-blocked-by-enhanced-security-policy-kb5020238-eb91e24d-eea4-4490-a281-86503adc8b27
This could be altered to take an SPWebApplication object, iterate through all SPSite objects in the Sites SPSiteCollection,
and then iterate through all SPWeb subsites in the AllWebs SPWebCollection.
.EXAMPLE
Get-WorkflowStatusForSite -SiteCollectionUrl https://sharepoint
.EXAMPLE
Get-WorkflowStatusForSite -SiteCollectionUrl https://sharepoint -IgnoreSubSites
.INPUTS
None
.OUTPUTS
PSCustomObject with Site, Web, WorkflowFileName and IsGoodWorkflow Result
Site Web WorkflowFileName IsGoodWorkflow
---- --- ---------------- --------------
SPSite Url=http://sharepoint http://sharepoint/WorkflowTest 2010 Log Workflow.xoml True
SPSite Url=http://sharepoint http://sharepoint/WorkflowTest Another Test Log.xoml True
.NOTES
Version .1
#>
param(
[Parameter(Position=2,HelpMessage="The site collection URL to validate.")]
[string]$SiteCollectionUrl,
[Parameter(Position=3,HelpMessage="Ignore subsites below the top-level site in the site collection.")]
[switch]$IgnoreSubSites
)
function IsGoodWorkflow
{
param
(
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)]
[System.Xml.XmlReader]$xmlReader
)
try {
$xDoc = [System.Xml.Linq.XDocument]::Load($xmlReader)
if ($null -ne $xDoc -and $null -ne $xDoc.Declaration -and $null -ne $xDoc.Declaration.Encoding)
{
if ($xdoc.Declaration.Encoding.ToLower() -ne "utf-8")
{
return $false
}
}
}
catch
{
return $false
}
return $true
}
function CheckWorkflowFile
{
param
(
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)]
[Microsoft.SharePoint.SPFile]$SPFile
)
$xmlReader = [System.Xml.XmlReader]::Create($SPFile.OpenBinaryStream())
if ($null -ne $xmlReader)
{
$isGood = $xmlReader | IsGoodWorkflow
$xmlReader.Close()
$xmlReader.Dispose()
return [PSCustomObject]@{
Site = $SPFile.Item.Web.Site
Web = $SPFile.Item.Web.Url
WorkflowFileName = $SPFile.Name
IsGoodWorkflow = $isGood
}
}
}
function CheckWorkflowsForWeb
{
param
(
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)]
[Microsoft.SharePoint.SPWeb]$SPWeb
)
write-host "Checking $SPweb"
$WorkflowsList = $SPWeb.Lists["Workflows"]
$results = @()
if ($WorkflowsList)
{
Write-Host "Found: " $WorkflowsList.Title
foreach ($listItem in $WorkflowsList.Items)
{
if ($listItem.File -and $listItem.File.Name.ToLower().EndsWith(".xoml"))
{
Write-Host "Found Workflow: " $listItem.File.Name
$results += (CheckWorkflowFile $listItem.File)
}
}
}
return $results
}
function CheckWorkflowsForSite
{
param
(
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)]
[Microsoft.SharePoint.SPSite]$SPSite,
[switch]$IgnoreSubSites
)
$results = @()
if ($IgnoreSubSites)
{
$SPWeb = $SPSite.RootWeb
$results += CheckWorkflowsForWeb $SPWeb
$SPWeb.Dispose()
}
else
{
foreach ($SPWeb in $SPSite.AllWebs)
{
$results += CheckWorkflowsForWeb $SPWeb
$SPWeb.Dispose()
}
}
return $results
}
if ([string]::IsNullOrEmpty($SiteCollectionUrl))
{
$SiteCollectionUrl = Read-Host "Please provide a site collection URL (Default: http://sharepoint)"
if ([String]::IsNullOrEmpty($SiteCollectionUrl))
{
$SiteCollectionUrl = "http://sharepoint"
}
}
$SPSite = Get-SPSite $SiteCollectionUrl -ErrorAction SilentlyContinue
if ($null -eq $SPSite)
{
Write-Host "Site collection $SiteCollectionUrl not found." -ForegroundColor Red
return;
}
$results = CheckWorkflowsForSite $SPSite
# Dispose of the Site
$SPSite.Dispose()
# Results can be exported to a CSV or manipulated
$results
変更履歴
次の表は、このトピックに対する最も重要な変更の一部をまとめたものです。
日付 |
説明 |
---|---|
2022 年 11 月 22 日 |
「原因」 セクションにメモを追加し、ワークフロー .xoml ファイルをスキャンする PowerShell スクリプトで 「回避策」 セクションを更新しました。 |