Change all subscritptions from one Report in one step
Hello, I want to make a Frontend to change all subscritptions from one Report in one step. Not completly knowing what happens internal I tried. The problem is that all 20 min the table sysjobsschedules will be updated with the old values. Does anyone know how to solve this problem, how to make this changes in SQL? Thanks!
May 25th, 2011 8:35am

Hi, what do you want to do with subscriptions? Remember to mark as an answer if this post has helped you.
Free Windows Admin Tool Kit Click here and download it now
May 25th, 2011 10:14am

Hi, the main problem is that we have a report with 49 subscriptions that runs every monday. If monday is a holiday it should run on tuesday an next week again on monday. It takes a lot of time to change the execution time for every subscription with IE. I am searching for the easiest way, to make this in one step. The customers wish that they can adjust the execution time of all subsrciptions of a report like "+ 1 day", "- 2 hours"... It would be nice if you can help me. Thanks and greets from cologne, Stephan!
May 26th, 2011 3:49am

Hi, the main problem is that we have a report with 49 subscriptions that runs every monday. If monday is a holiday it should run on tuesday and next week again on monday. It takes a lot of time to change the execution time for every subscription with IE. I am searching for the easiest way, to make this in one step. The customers wish that they can adjust the execution time of all subscriptions of a report like "+ 1 day", "- 2 hours"... It would be nice if you can help me. Thanks and greets from cologne, Stephan!
Free Windows Admin Tool Kit Click here and download it now
May 26th, 2011 3:52am

rss scripting as a way to go. Here is a simple script, which updates schedule day from "Monday" to "Tuersday" of all reports in specified folder. Save the script below in SubscriptionChanger.rss file Public Sub Main() Dim items As CatalogItem() = Nothing Dim subscriptions As Subscription() = Nothing Dim folder As String Dim reportCount as Integer = 0 Dim reportWithSubscriptionCount as Integer = 0 Dim subscriptionCount as Integer = 0 Dim subscriptionUpdated as Integer = 0 Dim extSettings As ExtensionSettings Dim desc As String Dim active As ActiveState Dim status As String Dim eventType As String Dim matchData As String Dim values As ParameterValue() = Nothing Dim oldDay as String = "Monday" Dim newDay as String = "Tuesday" Try items = rs.ListChildren(parentFolder, True) Console.WriteLine("Content of " + parentFolder) For Each catalogItem as CatalogItem in items if (catalogItem.Type = ItemTypeEnum.Report OR catalogItem.Type = ItemTypeEnum.LinkedReport) subscriptions = rs.ListSubscriptions(catalogItem.Path, Nothing) If Not (subscriptions Is Nothing) AND subscriptions.Length > 0 Then Console.WriteLine("{0} has {1} subscription(s)", catalogItem.Path, subscriptions.Length) Console.WriteLine("======================================") subscriptionCount = 0 For Each subscription as Subscription in subscriptions If Not (subscription Is Nothing) Then ' Retrieve properties for the subscription. rs.GetSubscriptionProperties(subscription.SubscriptionID, extSettings, desc, active, status, eventType, matchData, values) Console.WriteLine("Description: {0}", desc) Dim newMatchData As String = matchData.Replace(oldDay, newDay) rs.SetSubscriptionProperties(subscription.SubscriptionID, extSettings, desc, eventType, newMatchData, values) subscriptionCount = subscriptionCount + 1 subscriptionUpdated = subscriptionUpdated + 1 End If Next subscription Console.WriteLine("{0} subscriptions updated", subscriptionCount) reportWithSubscriptionCount = reportWithSubscriptionCount + 1 End If reportCount = reportCount + 1 end if Next catalogItem Console.WriteLine("Total {0} reports out of {1} reports have subscription. Schedule for {2} subscriptions updated from {3} to {4}", reportWithSubscriptionCount, reportCount, subscriptionUpdated, oldDay, newDay) Catch e As IOException Console.WriteLine(e.Message) Catch e As SoapException Console.WriteLine("Error : " + e.Detail.Item("ErrorCode").InnerText + " (" + e.Detail.Item("Message").InnerText + ")") End Try End Sub Execute the script with rs.exe: rs -i SubscriptionChanger.rss -s <a href="http://MyServer/reportserver">http://MyServer/reportserver</a> -v parentFolder="/MyReportFolder" >> SubscriptionChanger.log<br/>pause Remember to mark as an answer if this post has helped you.
May 26th, 2011 3:33pm

Thanks a lot! Great work! Stephan
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2011 3:06am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics