PoSh for SSRS: Essential Skills to manage your report server with PowerShell
Michael Wall Senior DBA, Great Western Malting Senior DBA at Great Western Malting I keep pretty busy as the only DBA supporting multiple business units in multiple time zones. Ask my about my VAXen. Oregon SQL Server User Group Michael Wall I’ve been a member for years, but last year I was accepted to the leadership team and boy has it been a lot of fun! Senior DBA, Great Western Malting Being a PASS community member /MichaelDWall1 Get out there and join a few user groups, present at some, and then go nuts and fly to a SQL Saturday in some town you’ve never visited before. I promise you’ll enjoy yourself! @MichaelDWall1 michael.wall.315
Thank you to our sponsors!!!!
Why aren’t you up here?
Agenda Origin, History, and location of the tools System and PowerShell Requirements Ways to install the tools on your system Help and how to get it! How to report errors on GitHub. A deep dive into the most useful of the new functions. Using Get-RsFolderContent and Write-RsFolderContent to simply backup and restore your SSRS environment.
Why am I here? You’re a casual user that wants to know more about SSRS and PowerShell You’re an experienced SSRS admin that wants a better way to administer your SSRS sites You’re an <fill in the blank> that just got told you’re in charge of SSRS!
Reporting Services tools and PowerShell – Origins The tools were released back in late 2016 by the Microsoft Reporting Services Team.
Reporting Services tools and PowerShell - Origins The tools were released back in late 2016 by the Microsoft Reporting Services Team. Microsoft is committed to supporting SSRS and its administration.
Reporting Services tools and PowerShell - Origins The tools were released back in late 2016 by the Microsoft Reporting Services Team. Microsoft is committed to supporting SSRS and its administration. The tools are located at: (https://github.com/Microsoft/ReportingServicesTools).
Reporting Services Tools - Requirements For full functionality, SSRS 2016 and Powershell 5+ are required.
Reporting Services Tools - Requirements For full functionality, SSRS 2016 and Powershell 5+ are required. Powershell 4 works just fine, but the install process is slightly different.
Reporting Services Tools - Requirements For full functionality, SSRS 2016 and Powershell 5+ are required. Powershell 4 works just fine, but the install process is slightly different. All features except for six work on all versions of SSRS from SQL2008R2 on up.
Installing the tools If you have PowerShell 5+, the install is very easy!
Installing the tools If you have PowerShell 5+, the install is very easy! Open up a PowerShell session *AS ADMINISTRATOR* and run the following command:
Installing the tools If you have PowerShell 5+, the install is very easy! Open up a PowerShell session *AS ADMINISTRATOR* and run the following command: Install-Module –Name ReportingServicesTools
Installing the tools If you have PowerShell 5+, the install is very easy! Open up a PowerShell session *AS ADMINISTRATOR* and run the following command: Install-Module –Name ReportingServicesTools With older versions of PowerShell, you need to use the Invoke- Expression command
Installing the tools If you have PowerShell 5+, the install is very easy! Open up a PowerShell session *AS ADMINISTRATOR* and run the following command: Install-Module –Name ReportingServicesTools With older versions of PowerShell, you need to use the Invoke- Expression command Invoke-Expression (Invoke-WebRequest https://aka.ms/rstools) Valid Internet connection or Local PowerShell Gallery required
Let’s have a demo!
Demo 1 Opening a Powershell Window Installing PoSh for SSRS Checking the commands once installed
Help or lack thereof First of all, the SSRS PS team has done a great job getting these commands out.
Help or lack thereof First of all, the SSRS PS team has done a great job getting these commands out. Adding them to GitHub was a brilliant idea and it means fast support from the moderators.
Help or lack thereof First of all, the SSRS PS team has done a great job getting these commands out. Adding them to GitHub was a brilliant idea and it means fast support from the moderators. But….remember the bit about SSRS 2016?
Help or lack thereof First of all, the SSRS PS team has done a great job getting these commands out. Adding them to GitHub was a brilliant idea and it means fast support from the moderators. But….remember the bit about SSRS 2016? It kind of makes things a little difficult if you *DON’T* have SSRS 2016 installed on your system.
Help or lack thereof First of all, the SSRS PS team has done a great job getting these commands out. Adding them to GitHub was a brilliant idea and it means fast support from the moderators. But….remember the bit about SSRS 2016? It kind of makes things a little difficult if you *DON’T* have SSRS 2016 installed on your system. But, this is my opinion. All I know is the commands can be a little challenging…
You know you want a demo…
Demo 2 Using Get-Help Using Get-Help –Examples Using Get-Help -Full
More on help Not necessarily help commands, but you have a number of flags you can set when running the PS commands.
More on help Not necessarily help commands, but you have a number of flags you can set when running the PS commands. -VERBOSE is one of the better ones. PowerShell will tell you what it’s doing.
Even more on help -debug is another very useful command. They also work together.
I’m looking for a demo
Demo 3 New-RsFolder New-RsDataSource Write-RsCatalogItem Write-RsCatalogItem |Out-GridView
Github – where to get the tool The official page for the tool can be found at: https://github.com/Microsoft/ReportingServicesTools
Github – where to get the tool The official page for the tool can be found at: https://github.com/Microsoft/ReportingServicesTools Issues can be reported at: https://github.com/Microsoft/ReportingServicesTools/issues
Github – where to get the tool The official page for the tool can be found at: https://github.com/Microsoft/ReportingServicesTools Issues can be reported at: https://github.com/Microsoft/ReportingServicesTools/issues As with any trouble ticket, be clear and state your environment. The moderators are there to help, but help them.
Did you take my demo??
Demo 4 Grant-AccessToRs Revoke-AccessToRs Grant-RsCatalogItemRole Revoke-RsCatalogItemAccess
A few common parameters -ReportServerUri – the location of your SSRS server -RsFolder – The location of the folder in SSRS that you wish to manipulate -Path – Stuff comes from here -Destination – Stuff goes to here -FolderName – The actual folder you wish to manipulate!
Please Sir, may I have a demo?
Demo 5 Set-RsDatabase
I could have had a demo!
Demo 6 Write-RsFolderContent Out-RsFolderContent
What can I do with all this? Restoring .RDL files from ReportServer database is a pain. This allows you a lot of flexibility in your SSRS environment. There is a *LOT* of pointing and clicking in the SSRS gui!
Thank you!!! Michael Wall Michael@OregonSQL.org @MichaelDWall1