Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 17778

Scheduling ConfigMgr reports to run using non-static dates

$
0
0

You’ll notice that when you create a subscription for a report that requires date parameters in the Configuration Manager console that you can only select a static date range.

 

CMConsoleSubscription

 

Typically when you are setting up a subscription, you want the report to run for a date range relative to when it is being delivered. For example, when you setup a daily subscription, you would want to use a date range since yesterday as that’d be the last time that you received the report.

 

You can easily do this using the report's default dates. Depending on your needs, you can also modify the default dates for existing or custom reports.

 

In this example, I’m using the built in Endpoint Protection “Infected Computers” report.

  • Connect to your Reporting Services Point http://SiteServer/Reports, open your reports directory (ConfigMgr_XXX where XXX is your site code), and open the Endpoint Protection folder
  • Hover your mouse over the “Infected Computers” report, click the down arrow, and select Subscribe

Note the Use Default options for the start and end date:

clip_image002


The default start and end dates for this report is currently set to a week of data. You can setup your report with the above options, and you’ll get a current weeks worth of data every time the report is delivered.

 

Let’s say that you want to change this to deliver one days worth of data. To do so, you’d need to edit the existing report with Report Builder. For more information about using Report Builder, you can go here.

 

Note: Any time you are making modifications to reports, you should keep the original and save the custom one to a new location.

 

If you don’t already have one, you should create a Custom Reports folder for modified reports:

  • Browse to SSRS website in IE http://SiteServer/Reports and open your reports folder (ConfigMgr_XXX)
  • Click New Folder and give it a name like “Custom Reports”

 

To edit an existing report, you simply right click the report in the ConfigMgr console and select Edit.

EditReport

 

This will open the report in report builder.

 

To modify the default values for the “Infected Computers” report to daily, you’d do the following:

  • Right click on the report from the console and select edit to launch Report Builder
  • Expand Datasets, right click StartEndDates and select Dataset Properties
  • In the query field, you’ll see the following:
    select DATEADD(day,-7,DATEDIFF(day, 0, GetUTCDate())) as StartDate, DATEADD(day,0,DATEDIFF(day, 0, GetUTCDate())) as EndDate
  • Modify the highlighted 7 above to a 1 to modify the default to run since yesterday rather than for the last week, and click okay
  • See Below

ModifyDataSet

 

To Save the report:

  • Click the circle at the top left of report builder and select Save As
  • Browse to your “Custom Reports” folder and name the report something like “Custom-Infected computers-DefaultYesterday”.

 

Now when you go back to the report to setup a subscription, you’ll see that the default start date is now yesterday rather than last week:

clip_image002[4]

 

Enjoy!

Ryan


Viewing all articles
Browse latest Browse all 17778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>