Introducing a new GitHub Repository and PowerShell scripts for Reporting Services

Today’s post is from Parth Shah, an engineer on the Reporting Services team here at Microsoft.

The Reporting Services team would like to announce our new GitHub Repository (https://github.com/Microsoft/Reporting-Services). We started this new repository to provide a central location where all of us can collaborate and share in a simple, easy and effortless manner. By creating a public repository where both RS developers as well as users can contribute to, we believe we will be able to generate, share, and improve upon content which will benefit the entire community.

The first item we’re sharing with the community through this repository is a set of PowerShell scripts that you can use for interacting with Reporting Services in Native Mode. This first set of scripts is designed to showcase how to automate certain tasks using PowerShell, and give you a starting point to use when you build your own scripts in the future. All of the scripts were written against SQL Server 2016 Reporting Services, so some scripts may not work in earlier versions of SSRS.

Get Started with PowerShell

To get started, you can either clone our Git Repository from https://github.com/Microsoft/Reporting-Services or download the entire Scripts folder as a zip file. Each ps1 file contains a function, which represents a single unit of operation that you would perform on your Reporting Services instance.

In order to avoid having to reference each ps1 file individually, we created a Setup.ps1 script. At the start of each PowerShell session, all you have to do is to import our Setup script (see below for an example). By importing our Setup script into your session, you will be able to use these functions in a cmdlet manner.

. Setup.ps1

As an example, if you want to grant Admin access to your Reporting Services default instance to John Doe (whose username is johnd), you can do so by executing following command:

Grant-AccessToRS -UserOrGroupName johnd -RoleName ‘System Administrator’

We have included additional information about each of the items using the PowerShell Help Syntax. This means if you are not sure on how to execute a function or what it does, all you need to do is:

Get-Help <function name>

Here is a list of all the functions we have ready for the community at the time of publishing this post. We’ll continue to publish more functions here and there as we move forward, and we’ll fix issues we discover with existing functions we publish. Please keep in mind that this is very much a “passion project” for the team currently, so our ability to provide support is limited and based on our personal availability.

We look forward to working with the community around this effort going forward, and can’t wait to see the additional content our users contribute to this effort!

Function Description
Backup-RSEncryptionKey This command backs up the encryption key used by SQL Server Reporting Services to protect sensitive content.
Grant-AccessOnCatalogItem This command grants access on catalog item to users or groups.
Grant-AccessToRS This command grants access to SQL Server Reporting Services to users or groups.
New-RSConfigurationSettingObject This command creates a new RSConfigurationSettingObject which is used to interact with the WMI Provider.
New-RSWebServiceProxy This command creates a new Web Service Proxy which is used to interact with the SOAP Endpoint.
Register-PowerBI This command registers Power BI information with SQL Server Reporting Services.
Restore-RSEncryptionKey This command restores encryption key on to the SQL Server Reporting Services.
Revoke-AccessOnCatalogItem This command revokes access on catalog item from users or groups.
Revoke-AccessToRS This command revokes access on SQL Server Reporting Services from users or groups.

Try it now and send us your feedback