I found a solution to this problem.
Create the following files:
RemoveSubscriptions.bat:
@echo OFF
SET Server=http://localhost/ReportServer_MSSQL_2008
SET ReportUrl=/test/reports/testreport
"C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\rs.exe" -i RemoveSubscriptions.rss -s %Server% -e Mgmt2010 -v reportUrl=%ReportUrl% > %date%.log
RemoveSubscriptions.rss:
Public Sub Main()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim subscriptions as Subscription() = rs.ListSubscriptions(reportUrl)
For Each item As Subscription in subscriptions
'Delete all subscriptions that are older then one month
If (item.LastExecutedSpecified AndAlso item.LastExecuted.AddMonths(1) < Date.Now) Then
Console.WriteLine("Removing subscription with id {0} from {1}", item.SubscriptionID, reportUrl)
rs.DeleteSubscription(item.SubscriptionID)
Console.WriteLine("{0}, {1}, {2}, {3}", item.SubscriptionID, item.Active, item.LastExecuted, item.LastExecutedSpecified)
End If
Next
End Sub
Now if you change the variables in the bat file and run the bat file it should remove all subscriptions that are older then 1 month this includes the actual sql job.
Warning: This will remove jobs that run more then once so if you have a report scheduled to run once a year it will be lost!