ReportingServicesTools

repository·master·Indexed 19 days ago

https://github.com/microsoft/reportingservicestools

A collection of PowerShell utilities designed to automate and manage operations for SQL Server Reporting Services (SSRS) and Power BI Report Server (PBIRS). The module provides commands for managing catalog items, subscriptions, data sources, and security policies via SOAP and REST APIs, and supports SQL Server releases from 2012 through 2022.

Tokens
2.3K
Snippets
4
Records
6
Agent score
18%

What's inside ReportingServicesTools

  1. Configure SSRS vs PBIRS instance versions

    master

    The scripts are designed primarily for Power BI Report Server (PBIRS), but they support SQL Server Reporting Services (SSRS) as well.

    When using commands, you can specify the version of the SQL Server Reporting Services instance. If no version is provided, the tools assume the default instance.

    Note: For SSRS 2017 and later, as well as PBIRS, you cannot change the instance names from the defaults 'SSRS' and 'PBIRS' respectively.

    Version Mapping:

    SQL Server ReleaseVersion
    SQL Server 201211
    SQL Server 201412
    SQL Server 201613
    SQL Server 201714
    SQL Server 201915
    SQL Server 202216
    Power BI Report Server15
  2. Set up local testing environment

    master

    To run tests locally, you must have a local default instance of SQL Server Reporting Services and the Pester testing framework installed.

    To install the specific required version of Pester, run:

    Install-Module -Name Pester -RequiredVersion 4.10.1

    To execute the tests (note: running . est.ps1 executes the CatalogItems test only, which does not modify the local Reporting Services installation):

    .\Test.ps1
    Install-Module -Name Pester -RequiredVersion 4.10.1
    .\Test.ps1
  3. Develop and test ReportingServicesTools locally

    master

    If you are contributing to the project or making local changes, follow these steps:

    1. Verify installed version:
    Get-Module -ListAvailable -Name ReportingServicesTools
    1. Install local changes: After cloning and modifying the code, remove the existing module and import your local version:
    Remove-Module ReportingServicesTools
    Import-Module .\ReportingServicesTools.psd1
    1. Enable debugging: Set the $VerbosePreference to continue to see detailed logging:
    $VerbosePreference = "continue"
    Get-Module -ListAvailable -Name ReportingServicesTools
    
    Remove-Module ReportingServicesTools
    Import-Module .\ReportingServicesTools.psd1
    
    $VerbosePreference = "continue"
  4. Install ReportingServicesTools PowerShell module

    master

    You can install the ReportingServicesTools module using several methods. The preferred method for most users is using Install-Module from the PowerShell Gallery.

    Preferred Method:

    Install-Module -Name ReportingServicesTools

    Alternative Methods:

    • Using the direct installation script:
    Invoke-Expression (Invoke-WebRequest https://raw.githubusercontent.com/Microsoft/ReportingServicesTools/master/Install.ps1)
    • Using the short URL:
    Invoke-Expression (Invoke-WebRequest https://aka.ms/rstools)
    Install-Module -Name ReportingServicesTools
  5. Reference all ReportingServicesTools commands

    master

    The following commands are available in the ReportingServicesTools module:

    CommandDescription
    Backup-RsEncryptionKeyBacks up the encryption key used by SSRS to protect sensitive content.
    Connect-RsReportServerConnects to Reporting Services and sets default connection information.
    Copy-RsSubscriptionAdds a retrieved subscription to an existing report (use with Get-RsSubscription).
    Export-RsSubscriptionXmlExports a collection of subscriptions to an XML file on disk.
    Get-RsFolderContentLists all catalog items under a folder.
    Get-RsDataSourceLists information about the data source at the specified path.
    Get-RsDeploymentConfigRetrieves deployment configurations from a Reporting Services project file.
    Get-RsItemReferenceGets the item references of a report or a dataset.
    Get-RsItemDataSourceFetches embedded data sources associated with a report.
    Get-RsCatalogItemRoleRetrieves access to catalog items for users or groups.
    Get-RsRestCacheRefreshPlanFetches a CacheRefreshPlan from a Power BI report.
    Get-RsRestCacheRefreshPlanHistoryFetches the history of CacheRefreshPlan(s) from a Power BI report.
    Get-RsRestDataSourceFetches a datasource item from a folder.
    Get-RsRestFolderContentFetches data sources related to a catalog item from the Report Server.
    Get-RsRestItemFetches a catalog item from the Report Server using the REST API.
    Get-RsRestItemAccessPolicyRetrieves access policies to SSRS or PBIRS Instance from users/groups.
    Get-RsRestItemDataModelParametersFetches Data Model Parameters related to a Catalog Item report (Power BI Reports, ReportServer Oct/2020+).
    Get-RsRestItemDataSourceFetches embedded data sources for Paginated or Power BI reports via REST.
    Get-RsSubscriptionRetrieves information about subscriptions for a report.
    Grant-RsRestItemAccessPolicyGrants access policies on SSRS or PBIRS Instance via REST.
    Grant-RsSystemRoleGrants access to SSRS to users or groups. (Alias: Grant-AccessToRs)
    Grant-RsCatalogItemRoleGrants access to catalog items to users or groups. (Alias: Grant-AccessOnCatalogItem)
    Import-RsSubscriptionXmlImports subscriptions from an XML file (typically from Export-RsSubscriptionXml).
    Initialize-RsInitializes Report Server post-installation (requires DB config and URL reservation).
    New-RsConfigurationSettingObjectCreates a RsConfigurationSettingObject to interact with the WMI Provider.
    New-RsDataSourceCreates/overwrites the data source to the specified path.
    New-RsFolderCreates a new folder in the specified path.
    New-RsRestCacheRefreshPlanCreates a CacheRefreshPlan for a specified Power BI Report.
    New-RsRestCredentialsByUserObjectCreates a CredentialsByUser object for Set-RsRestItemDataSource.
    New-RsRestCredentialsInServerObjectCreates a CredentialsInServer object for Set-RsRestItemDataSource.
    New-RsRestFolderCreates a new folder via the REST Endpoint.
    New-RsRestSessionCreates a session object for subsequent REST Endpoint calls.
    New-RsSubscriptionAdds a new subscription to an existing report.
    New-RsScheduleXmlCreates an XML string definition of a subscription schedule.
    New-RsWebServiceProxyCreates a new Web Service Proxy to interact with the SOAP Endpoint.
    Out-RsCatalogItemDownloads a catalog item.
    Out-RsFolderContentDownloads all catalog items in a folder.
    Out-RsRestFolderContentDownloads all catalog items under a folder via REST.
    Out-RsRestCatalogItemDownloads a catalog item via REST.
    Publish-RsProjectDeploys a Reporting Services project to a Power BI Report Server.
    Register-PowerBIRegisters Power BI information with SSRS. (Alias: Register-RSPowerBI)
    Remove-RsCatalogItemRemoves the catalog item at the specified path.
    Remove-RsRestCatalogItemRemoves catalog item via REST.
    Remove-RsRestFolderRemoves folder via REST.
    Remove-RSSubscriptionRemoves a subscription associated with a report.
    Restore-RsEncryptionKeyRestores the encryption key to SSRS.
    Revoke-RsCatalogItemAccessRevokes access to a catalog item. (Alias: Revoke-AccessOnCatalogItem)
    Revoke-RsRestItemAccessPolicyRevokes access to catalog items via REST.
    Revoke-RsSystemAccessRevokes access on SSRS from users/groups. (Alias: Revoke-AccessToRs)
    Set-RsDatabaseConfigures the database used by SSRS.
    Set-RsDatabaseCredentialsConfigures credentials for the SSRS database.
    Set-RsDataSetLinks a report to a dataset. (Alias: Set-RsDataSetReference)
    Set-RsDataSourceUpdates information associated with a data source. (Alias: Set-RsDataSourceReference)
    Set-RsDataSourcePasswordSets the password associated with a data source.
    Set-RsEmailSettingsConfigures SSRS email settings for basic auth. (Aliases: Set-RsEmailSettingsAsBasicAuth, Set-RsEmailSettingsAsNoAuth, Set-RsEmailSettingsAsNTLMAuth)
    Set-RsItemDataSourceUpdates embedded data sources associated with a report.
    Set-RsDataSourceReferenceOverrides report/dataset reference to a shared data source.
    Set-RsRestItemDataModelParametersUpdates data sources related to a catalog item via REST.
    Set-RsRestItemDataSourceUpdates embedded data sources for Paginated/Power BI reports via REST.
    Set-RsSharedDataSourceLinks a report or dataset to a data source.
    Set-RsUrlReservationConfigures SSRS URLs.
    Set-PbiRsUrlReservationConfigures Power BI Report Server URLs.
    Set-RsSubscriptionUpdates existing subscriptions (use with Get-RsSubscription).
    Start-RsRestCacheRefreshPlanRefreshes CacheRefreshPlan via REST.
    Test-RsRestItemDataSourceTests connection for Paginated or Power BI report DataSources via REST.
    Write-RsCatalogItemUploads a report, dataset, or data source via SOAP.
    Write-RsFolderContentUploads all items in a folder.
    Write-RsRestCatalogItemUploads a report, dataset, or mobile report via REST.
    Write-RsRestFolderContentUploads all items in a folder via REST.