Pazīmes
Kad instalējat šādus oktobra drošības atjauninājumus Microsoft SharePoint Server, daži Microsoft SharePoint 2010 darbplūsmas scenāriji, iespējams, ir bloķēti. Turklāt SharePoint vienotās reģistrēšanas sistēmas (ULS) žurnālos tiek reģistrēti "6ksbk" notikuma tagi.
Iemesls
Lai uzlabotu SharePoint darbplūsmu drošību, SharePoint tagad atbalsta tikai UTF-8 rakstzīmju kodējumu darbplūsmas .xoml failiem.
Piezīme.: SharePoint darbplūsmas rīki, piemēram, SharePoint Designer, Microsoft Visual Studio un Ninatex, pēc noklusējuma izveido darbplūsmas .xoml failus, izmantojot UTF-8 rakstzīmju kodējumu. Šis drošības uzlabojums neietekmēs klientus, ja vien viņi nav manuāli rediģējuši savus darbplūsmas .xoml failus un pārvērtuši tos par citu rakstzīmju kodējumu. Šī problēma ir dokumentēta šajā KB rakstā par ļoti retu iespējamību, ka klienti, iespējams, ir izvēlējušies to darīt.
Risinājums
Ja esat manuāli rediģējis darbplūsmu .xoml failu un pārvērtis to par rakstzīmju kodējumu, kas nav UTF-8, fails ir jārediģē atkārtoti, lai to konvertētu atpakaļ uz UTF-8. Pārliecinieties, vai faila XML paziņojums definē kodējumu kā UTF-8, saglabājiet failu UTF-8 rakstzīmju kodējuma formātā teksta redaktorā un pēc tam to atkārtoti izceliet.
Tālāk norādīto PowerShell skriptu var izmantot SharePoint pārvaldības čaulā, lai skenētu darbplūsmu .xoml failus SharePoint vietņu kolekcijā un noteiktu, vai tās ietekmē šīs izmaiņas. Darbplūsmas IsGoodWorkflow tiek izmantota True .xoml failiem, kas izmanto UTF-8 rakstzīmju kodējumu un ir saderīgi ar šo izmaiņu. Satura IsGoodWorkflow tiks pielāgoti False .xoml failiem, kuriem netiek izmantots UTF-8 rakstzīmju kodējums un kura ir jāmaina.
<#
.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
Izmaiņu vēsture
Šajā tabulā apkopotas dažas no svarīgākajām šīs tēmas izmaiņām.
Datums |
Apraksts |
---|---|
2022. gada 22. novembris |
Pievienota piezīme sadaļā "Iemesls" un atjaunināta sadaļa "Risinājums" ar PowerShell skriptu, lai skenētu darbplūsmas .xoml failus. |