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
- Download SQL Server 2016
- Download Mobile Report Publisher
- Download Report Builder
- Download SQL Server Data Tools for Visual Studio 2015
- Check out the documentation: What’s new in Reporting Services (SQL Server 2016)
- Post in the Reporting Services forum (or if you prefer, send us an email)
- Join the conversation on Twitter: @SQLServerBI, #SSRS
Comments
- Anonymous
August 12, 2016
Thanks for this, I'm messing with SSRS 2016 and can't wait to add this to the mix! - Anonymous
August 23, 2016
This is great guys! I think a cool addition would be a powershell script to make configuration changes to catalog items. For example, setting hidden items, inserting descriptions, etc. I guess I could do my research and build one myself. I would if I had the time and knowledge. I might be lacking in one or more of those areas. - Anonymous
August 25, 2016
This is great progress toward automation of SSRS. What would be truly fantastic is more capability to use PowerShell DSC to more deeply configure SSRS instances within infrastructure as code pipelines. We in particular would be looking for the ability to add custom extensions. - Anonymous
August 25, 2016
Hi guys!Great work :-). What I am wondering is why don't you write a PowerShell Module for these commands? So you can just import the module and you are done (it can be also imported automatically if stored at the right place on your disk). If you like to, I can support you there.Thanks and have a nice dayFrank- Anonymous
September 01, 2016
A module is a logical next step and, as it happens, the community has already done some great work on one. You are welcome to contribute as well!
- Anonymous