SQL Server Reporting Servicesを構成する手動の手順

重要

このバージョンのService Managerはサポート終了に達しました。 Service Manager 2022 にアップグレードすることをお勧めします。

Service Manager データ ウェアハウス管理サーバーの展開中に、Microsoft SQL Server Reporting Services (SSRS) を展開するサーバーを指定できます。 セットアップ中は、既定でデータ ウェアハウス管理サーバーのホスト コンピューターが選択されます。 SSRS をホストする別のコンピューターを指定した場合は、この手順に従ってサーバーを準備するように求められます。 SSRS をホストするリモート コンピューターを準備する手順は、大きく次の作業に分かれます。各作業の詳細は、この後に説明します。

  • Service Manager のインストール メディアにある Microsoft.EnterpriseManagement.Reporting.Code.dll を、SSRS をホストするコンピューターにコピーします。

  • SSRS をホストするコンピューターにある rssrvpolicy 構成ファイルに、コード セグメントを追加します。

  • 同じコンピューターにある rsreportserver 構成ファイルの既存の Data セグメントに、Extension タグを追加します。

SQL Serverの既定のインスタンスを使用した場合は、Windows エクスプローラー を使用して Microsoft.EnterpriseManagement.Reporting.Code.dll (Service Manager インストール メディアの [前提条件] フォルダーにあります) をフォルダー \Program Files\Microsoft SQL Server\MSRS13 にドラッグします。SSRS をホストしているコンピューター上の MSSQLSERVER\Reporting Services\ReportServer\Bin。 SQL Serverの既定のインスタンスを使用しなかった場合、必要なフォルダーのパスは \Program Files\Microsoft SQL Server\MSRS13 です。<>INSTANCE_NAME\Reporting Services\ReportServer\Bin。 次の手順では、既定のインスタンス名を使用しています。

Microsoft.EnterpriseManagement.Reporting.Code.dll ファイルをコピーする

次の手順に従います。

  1. SSRS をホストするコンピューターで、Windows エクスプローラーのインスタンスを開きます。

  2. SQL Server 2016 の場合は、フォルダー \Program Files\Microsoft SQL Server\MSRS13 を見つけます。MSSQLSERVER\Reporting Services\ReportServer\Bin。

  3. エクスプローラーの 2 つ目のインスタンスを起動して、Service Manager のインストール メディアがあるドライブを見つけ、Prerequisites フォルダーを開きます。

  4. [前提条件] フォルダー で、Microsoft.EnterpriseManagement.Reporting.Code.dllを選択し、いずれかの手順 2. で配置したフォルダーにドラッグします。

rssrvpolicy.config ファイルにコード セグメントを追加する

次の手順に従います。

  1. SSRS をホストするコンピューターで、\Program Files\Microsoft SQL Server\MSRS13 で rssrvpolicy.config ファイルを見つけます。SQL Server 2016 の MSSQLSERVER\Reporting Services\ReportServer フォルダー。

  2. メモ帳などの適切な XML エディターで rssrvpolicy.config ファイルを開きます。

  3. rssrvpolicy.config ファイルを下にスクロールし、<CodeGroup> コード セグメントを見つけます。 次に、<CodeGroup> セグメントの例を示します。

    <CodeGroup
       class="UnionCodeGroup"
       version="1"
       PermissionSetName="FullTrust">
       <IMembershipCondition
          class="UrlMembershipCondition"
          version="1"
          Url="$CodeGen$/*"
       />
    </CodeGroup>
    
  4. 次の <CodeGroup> セグメントを、他の <CodeGroup> セグメント内の同じセクションに追加します。

    <CodeGroup
       class="UnionCodeGroup"
       version="1"
       PermissionSetName="FullTrust"
       Name="Microsoft System Center Service Manager Reporting Code Assembly"
       Description="Grants the SCSM Reporting Code assembly full trust permission.">
       <IMembershipCondition
          class="StrongNameMembershipCondition"
          version="1"
          PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9"
    />
    </CodeGroup>
    
  5. 変更を保存して、XML エディターを閉じます。

rsreportserver.conf ファイルの Data セグメントに Extension タグを追加する

次の手順に従います。

  1. SSRS をホストしているコンピューターで、\Program Files\Microsoft SQL Server\MSRS13 で rsreportserver.config ファイルを見つけます。SQL Server 2016 の MSSQLSERVER\Reporting Services\ReportServer フォルダー。

  2. メモ帳などの適切な XML エディターで rsreportserver.config ファイルを開きます。

  3. rsreportserver.config ファイルをスクロールして、<Data> というコード セグメントまで移動します。 このファイルには 1 つの <Data> コード セグメントしかありません。

  4. 次の Extension セグメントを、<Data> コード セグメント内の他のすべての Extension タグに追加します。

    <Extension Name="SCDWMultiMartDataProcessor" Type="Microsoft.EnterpriseManagement.Reporting.MultiMartConnection, Microsoft.EnterpriseManagement.Reporting.Code" />
    
  5. 変更を保存して、XML エディターを閉じます。

SSRS のインストールを確認する

Service Manager Data Warehouse (DW) バージョン 2016 以降では、次の既知の問題が発生します。

Service Manager Data Warehouse (DW) では、次の既知の問題が発生します。

SQL Server Reporting Services (SSRS) がData Warehouse管理サーバーでローカルで実行されていて、SSRS が 2017 以降の場合、Data Warehouse セットアップは正常に完了しますが、指定されたローカル SSRS インスタンスが正しく構成されない可能性があります。

次のスクリプトを使用して、LOCAL SSRS のインストールが正しく構成されていて、Service Manager Data Warehouseで使用できるかどうかを確認します。

注意

この PowerShell スクリプトは、Service Manager Data Warehouseインストール後に実行できます。 スクリプトは構成に変更を加えませんが、検証します。 スクリプトは、必要な回数だけ実行できます。

#region function definitions

function SelfElevate() {
    #got from http://www.expta.com/2017/03/how-to-self-elevate-powershell-script.html   and changed a bit
    if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
     if ([int](Get-WmiObject -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
      $CommandLine = "-File `"" + $Script:MyInvocation.MyCommand.Path + "`" " + $Script:MyInvocation.UnboundArguments
      Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine
      Exit
     }
    }
}
function EndScriptExecution() {
    Write-Host ""
    Read-Host "Press ENTER to stop execution" 
    Exit
}
#endregion
#region Init
SelfElevate
#endregion 

#region Select SSRS service
$ssrsServicesAvailable = gwmi win32_service | ?{ $_.DisplayName -like 'SQL Server Reporting Services*' }
if ($ssrsServicesAvailable -eq $null) {
    Write-Host "No SSRS service(s) detected on this machine. " -NoNewline
    Write-Host "Aborting ..." -ForegroundColor Yellow
    EndScriptExecution
}

if ( ($ssrsServicesAvailable | Measure-Object).Count -eq 1) {
    $ssrsServiceToVerify = ($ssrsServicesAvailable | Select-Object -Property DisplayName, State, PathName) | Select-Object -First 1
}
else {
    $ssrsServiceToVerify = $ssrsServicesAvailable | Select-Object -Property DisplayName, State, PathName | Out-GridView  -Title 'Select the SSRS service to verify and then click OK...' -OutputMode Single
    if ($ssrsServiceToVerify -eq $null) {
        Write-Host "No SSRS service selected to verify. " -NoNewline
        Write-Host "Aborting ..." -ForegroundColor Yellow
        EndScriptExecution
    }
}
#endregion

#region Preparation
Write-Host "--------------------------------------------------------------------"
Write-Host "Verifiying selected SSRS service : " -NoNewline
Write-Host "'$($ssrsServiceToVerify.DisplayName)'"  -ForegroundColor Cyan
Write-Host "--------------------------------------------------------------------"
Write-Host ""

$ssrsExePath = $ssrsServiceToVerify.PathName.Replace('"','')
$ssrsExeFileVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($ssrsExePath)
$ssrsMajorVersion = $ssrsExeFileVersion.ProductMajorPart
$ssrsVersionDisplayName = switch ($ssrsMajorVersion)
{
    11 {"2012"}
    12 {"2014"}
    13 {"2016"}
    14 {"2017"}
    15 {"2019"}
    default {""}
}
if ($ssrsVersionDisplayName -eq "") {
    Write-Host "Unknown SSRS Version detected. " -NoNewline
    Write-Host "Aborting ..." -ForegroundColor Yellow
    EndScriptExecution
}

[System.IO.DirectoryInfo]$ssrsReportServerFolder = (Get-Item -Path $ssrsExePath).Directory.Parent
if ($ssrsMajorVersion -ge 14) {
    $ssrsReportServerFolder =    Join-Path $ssrsReportServerFolder.FullName "ReportServer"
}
[string]$ssrsReportServerFolder = $ssrsReportServerFolder.FullName 
[string]$ssrsReportServerBinFolder = Join-Path $ssrsReportServerFolder "bin"
#endregion

#region Checking DLL
$scsmDllFileExists = $false
$scsmDllFileName = "Microsoft.EnterpriseManagement.Reporting.Code.dll"
$scsmDllFilePath = Join-Path $ssrsReportServerBinFolder $scsmDllFileName
$scsmDllFileExists = (Test-Path -Path $scsmDllFilePath)
if (-not $scsmDllFileExists) {
    Write-Host "ERROR: "  -ForegroundColor Yellow -NoNewline
    Write-Host "The file '$scsmDllFileName' does *NOT* exist in '$ssrsReportServerBinFolder'"
}
else {
    Write-Host " Pass: The file '$scsmDllFileName' does exist in '$ssrsReportServerBinFolder'" 
}
Write-Host ""
#endregion

#region Checking rssrvpolicy.config
$rssrvpolicy_configIsCorrect = $false
$rssrvpolicy_configFileName = "rssrvpolicy.config"
$rssrvpolicy_configFilePath = Join-Path $ssrsReportServerFolder $rssrvpolicy_configFileName
$rssrvpolicy_configFileExists = (Test-Path -Path $rssrvpolicy_configFilePath)
if (-not $rssrvpolicy_configFileExists) {
    Write-Host "$rssrvpolicy_configFileName does *NOT* exist in $ssrsReportServerFolder" -ForegroundColor Yellow
}
if ($rssrvpolicy_configFileExists) {    
    
    [xml]$xml = Get-Content $rssrvpolicy_configFilePath
    
    $tagNameToFind = "CodeGroup"
    $attributeNameToFind = "Name"
    $attributeValueToFind = "Microsoft System Center Service Manager Reporting Code Assembly"
    $nodeToFind = Select-Xml -XPath "//$tagNameToFind[@$attributeNameToFind='$attributeValueToFind']" -Xml $xml

    if ($nodeToFind -eq $null) {
        Write-Host "ERROR: "  -ForegroundColor Yellow -NoNewline
        Write-Host "The file '$rssrvpolicy_configFileName' in '$ssrsReportServerFolder' does *NOT* contain the correct <$tagNameToFind> node." 
    }
    else {

        $CodeGroup_NodeToVerify = [System.Xml.XmlNode]$nodeToFind.Node
        $IMembershipCondition_NodeToVerify = [System.Xml.XmlNode]$CodeGroup_NodeToVerify.IMembershipCondition

        $rssrvpolicy_configIsCorrect =  ( $CodeGroup_NodeToVerify.class -eq "UnionCodeGroup" `
            -and $CodeGroup_NodeToVerify.version -eq "1" `
            -and $CodeGroup_NodeToVerify.PermissionSetName -eq "FullTrust" `
            -and $IMembershipCondition_NodeToVerify.class -eq "StrongNameMembershipCondition" `
            -and $IMembershipCondition_NodeToVerify.version -eq "1" `
            -and $IMembershipCondition_NodeToVerify.PublicKeyBlob -eq "0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9"
        ) 

        if (-not $rssrvpolicy_configIsCorrect) {
            Write-Host "ERROR: "  -ForegroundColor Yellow -NoNewline
            Write-Host "The <$tagNameToFind> node in '$rssrvpolicy_configFileName' in '$ssrsReportServerFolder' does exists but its content is *NOT* correct."
        }
        else {
            Write-Host " Pass: The content of '$rssrvpolicy_configFileName'    in '$ssrsReportServerFolder' is correct."             
        }
    }

}
Write-Host ""
#endregion

#region Checking rsreportserver.config
$rsreportserver_configIsCorrect = $false
$rsreportserver_configFileName = "rsreportserver.config"
$rsreportserver_configFilePath = Join-Path $ssrsReportServerFolder $rsreportserver_configFileName
$rsreportserver_configFileExists = (Test-Path -Path $rsreportserver_configFilePath)
if (-not $rsreportserver_configFileExists) {
    Write-Host "$rsreportserver_configFileName does *NOT* exist in $ssrsReportServerFolder" -ForegroundColor Yellow
}
if ($rsreportserver_configFileExists) {
     
    [xml]$xml = Get-Content $rsreportserver_configFilePath
    
    $tagNameToFind = "Extension"
    $attributeNameToFind = "Name"
    $attributeValueToFind = "SCDWMultiMartDataProcessor"
    $nodeToFind = Select-Xml -XPath "//$tagNameToFind[@$attributeNameToFind='$attributeValueToFind']" -Xml $xml

    if ($nodeToFind -eq $null) {
        Write-Host "ERROR: "  -ForegroundColor Yellow -NoNewline
        Write-Host "The file '$rsreportserver_configFileName' in '$ssrsReportServerFolder' does *NOT* contain the correct <$tagNameToFind> node."
    }
    else {

        $Extension_NodeToVerify = [System.Xml.XmlNode]$nodeToFind.Node
        $rsreportserver_configIsCorrect =  ( $Extension_NodeToVerify.Type.Replace(" ","") -eq "Microsoft.EnterpriseManagement.Reporting.MultiMartConnection, Microsoft.EnterpriseManagement.Reporting.Code".Replace(" ","") ) 

        if (-not $rsreportserver_configIsCorrect) {
            Write-Host "ERROR: "  -ForegroundColor Yellow -NoNewline
            Write-Host "The <$tagNameToFind> node in '$rsreportserver_configFileName' in '$ssrsReportServerFolder' does exists but its content is *NOT* correct." 
        }
        else {
            Write-Host " Pass: The content of '$rsreportserver_configFileName' in '$ssrsReportServerFolder' is correct."             
        }
    }

}
Write-Host ""
#endregion

#region Conclusion
""
Write-Host "Conclusion:" -ForegroundColor Cyan
Write-Host "==========="
if ($scsmDllFileExists -and $rsreportserver_configIsCorrect -and $rssrvpolicy_configIsCorrect) {
    Write-Host "The selected SSRS instance is configured correctly."
}
else {
    Write-Host "The selected SSRS instance is " -NoNewline
    Write-Host "*NOT* configured correctly." -ForegroundColor Yellow
    Write-Host "Please follow the steps at  " -NoNewline
    Write-Host "https://learn.microsoft.com/system-center/scsm/config-remote-ssrs" -ForegroundColor Yellow
}
EndScriptExecution
#endregion

次の手順

  • Service Managerで AlwaysOn 可用性グループを使用してフェールオーバー環境をサポートするには、「フェールオーバーをサポートするために AlwaysOn 可用性グループSQL Server使用する」を参照してください。