Powershell or VB RSS Script to remove RDL files from SSRS

Posted on 2012-08-13
Last Modified: 2013-06-13
We have an odd challenge - I need to find a way to remove all RDL files from SQL Reporting Services 2008.  The reports all are save in http://servername/reports, and we want to delete EVERYTHING with the exception of a directory named DefaultReports.
I have found Powershell script to export these items or add additional RDL files, but not delete them.
Any assistance would be appreciated!
Question by:Scudboy
    LVL 44

    Expert Comment

    by:Rainer Jeschor
    LVL 8

    Accepted Solution

    Reporting Services comes with a command line utility called rs.exe.  This utility is designed to make it very easy to write code to work with SSRS.  You need to create a script file the rs can use to execute against the SSRS web service.

    To use it, it is simply a case of:
    RS.exe -i scriptfilename -s serverurl (probably http://servername/reportserver)

    Here is a reference to some code that will delete reports from an SSRS server:

    Author Closing Comment

    Thank you!  This was perfect and worked very well.  

    Powershell for some reason just hand me chasing my tail, and I had yet to find code that actually worked - it really took the RSS script run with the rs.exe utility to get the job done.
    LVL 2

    Expert Comment

    What do I need to do to make it link to a data source in a different folder than where the reports exist?

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
    You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.
    This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now