Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By : Donabel Santos
Book Image

SQL Server 2014 with PowerShell v5 Cookbook

By: Donabel Santos

Overview of this book

Table of Contents (21 chapters)
SQL Server 2014 with PowerShell v5 Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Listing items in your SSRS Report Server


In this recipe, we will list items in an SSRS Report Server that is configured in native mode.

Getting ready

Identify your SSRS 2014 Report Server URL. We will need to reference the ReportService2010 web service, and you can reference it using:

<ReportServer URL>/ReportService2010.asmx

For this recipe, we will use the default Windows credential to authenticate to the server.

How to do it...

Let's explore the code required to list items in your SSRS Report Server that is configured in native mode:

  1. Open PowerShell ISE as an administrator.

  2. Add the following script and run it:

    $reportServerUri  = "http://localhost/ReportServer/ReportService2010.asmx"
    $proxy = New-WebServiceProxy -Uri $reportServerUri -UseDefaultCredential
    
    #list all children
    $proxy.ListChildren("/", $true) |
    Select-Object Name, TypeName, Path, CreationDate |
    Format-Table -AutoSize
    
    #if you want to list only reports
    $proxy.ListChildren("/", $true) |
    Where-Object TypeName -eq "Report" |
    Select...