Bagikan melalui


Langkah-langkah manual untuk mengonfigurasi SQL Server Reporting Services

Penting

Versi Service Manager ini telah mencapai akhir dukungan. Kami menyarankan Anda untuk meningkatkan ke Service Manager 2022.

Selama penyebaran server manajemen gudang data Service Manager, Anda dapat menentukan server tempat Microsoft SQL Server Reporting Services (SSRS) akan disebarkan. Selama penyiapan, komputer yang menghosting server manajemen gudang data dipilih secara default. Jika Anda menentukan komputer lain untuk menghosting SSRS, Anda diminta untuk mengikuti prosedur ini untuk menyiapkan server. Menyiapkan komputer jarak jauh untuk menghosting SSRS melibatkan langkah-langkah berikut, yang tercakup secara rinci di bagian ini:

  • Salin Microsoft.EnterpriseManagement.Reporting.Code.dll dari media penginstalan Service Manager ke komputer yang menghosting SSRS.

  • Tambahkan segmen kode ke file konfigurasi rssrvpolicy di komputer yang menghosting SSRS.

  • Tambahkan tag Ekstensi ke segmen Data yang ada dalam file konfigurasi rsreportserver di komputer yang sama.

Jika Anda menggunakan instans default SQL Server, gunakan Windows Explorer untuk menyeret Microsoft.EnterpriseManagement.Reporting.Code.dll (yang terletak di folder Prasyarat di media penginstalan Service Manager Anda) ke folder \Program Files\Microsoft SQL Server\MSRS13. MSSQLSERVER\Reporting Services\ReportServer\Bin di komputer yang menghosting SSRS. Jika Anda tidak menggunakan instans default SQL Server, jalur folder yang diperlukan adalah \Program Files\Microsoft SQL Server\MSRS13.<>INSTANCE_NAME\Reporting Services\ReportServer\Bin. Dalam prosedur berikut, nama instans default digunakan.

Salin file Microsoft.EnterpriseManagement.Reporting.Code.dll

Gunakan langkah-langkah berikut:

  1. Di komputer yang akan menghosting SSRS jarak jauh, buka instans Windows Explorer.

  2. Untuk SQL Server 2016, temukan folder \Program Files\Microsoft SQL Server\MSRS13. MSSQLSERVER\Reporting Services\ReportServer\Bin.

  3. Mulai instans kedua Windows Explorer, temukan drive yang berisi media penginstalan Service Manager, lalu buka folder Prasyarat.

  4. Di folder Prasyarat, pilih Microsoft.EnterpriseManagement.Reporting.Code.dll, dan seret ke folder yang Anda lokasikan di salah satu langkah 2.

Menambahkan segmen kode ke file rssrvpolicy.config

Gunakan langkah-langkah berikut:

  1. Di komputer yang akan menghosting SSRS, temukan file rssrvpolicy.config di \Program Files\Microsoft SQL Server\MSRS13. Folder MSSQLSERVER\Reporting Services\ReportServer untuk server SQL 2016.

  2. Menggunakan editor XML pilihan Anda (seperti Notepad), buka file rssrvpolicy.config.

  3. Gulir file rssrvpolicy.config dan temukan <CodeGroup> segmen kode. Kode berikut menunjukkan contoh <CodeGroup> segmen.

    <CodeGroup
       class="UnionCodeGroup"
       version="1"
       PermissionSetName="FullTrust">
       <IMembershipCondition
          class="UrlMembershipCondition"
          version="1"
          Url="$CodeGen$/*"
       />
    </CodeGroup>
    
  4. Tambahkan segmen berikut <CodeGroup> secara keseluruhan di bagian yang sama dengan segmen lain <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. Simpan perubahan dan tutup editor XML.

Menambahkan tag Ekstensi ke segmen Data di file rsreportserver.conf

Gunakan langkah-langkah berikut:

  1. Di komputer yang menghosting SSRS, temukan file rsreportserver.config di \Program Files\Microsoft SQL Server\MSRS13. Folder MSSQLSERVER\Reporting Services\ReportServer untuk server SQL 2016.

  2. Menggunakan editor XML pilihan Anda (seperti Notepad), buka file rsreportserver.config.

  3. Gulir file rsreportserver.config dan temukan <Data> segmen kode. Hanya ada satu <Data> segmen kode dalam file ini.

  4. Tambahkan tag berikut Extension ke <Data> segmen kode di mana semua tag lainnya Extension adalah:

    <Extension Name="SCDWMultiMartDataProcessor" Type="Microsoft.EnterpriseManagement.Reporting.MultiMartConnection, Microsoft.EnterpriseManagement.Reporting.Code" />
    
  5. Simpan perubahan dan tutup editor XML.

Memverifikasi penginstalan SSRS

Di Service Manager Data Warehouse (DW) versi 2016 dan kemudian masalah yang diketahui berikut ini diamati:

Di Gudang Data Manajer Layanan (DW), masalah umum berikut diamati:

Jika SQL Server Reporting Services (SSRS) berjalan secara lokal di Server Manajemen Gudang Data, dan SSRS adalah 2017 atau yang lebih baru, Penyiapan Gudang Data berhasil diselesaikan, tetapi mungkin tidak mengonfigurasi instans SSRS lokal yang ditentukan dengan benar.

Gunakan skrip di bawah ini untuk memverifikasi apakah penginstalan SSRS LOKAL dikonfigurasi dengan benar dan dapat digunakan dengan Gudang Data Manajer Layanan.

Catatan

Skrip PowerShell ini dapat dijalankan setelah penginstalan Gudang Data Manajer Layanan. Skrip tidak akan membuat perubahan apa pun pada konfigurasi tetapi memverifikasinya. Anda dapat menjalankan skrip sebanyak yang diperlukan.

#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

Langkah berikutnya