How to add Collection parameter in SCCM report

5004

In this post we will see how to add collection parameter in SCCM report. In other words we are creating custom reports by adding parameters to the report. Report parameters enable you to control report data, connect related reports together and vary report presentation. Configuration Manager 2012 R2 comes with good number of built-in reports, but at some point there will be a need to create or modify an existing report to provide information which is not part of one of the core reports. In this post, as an example we will see the method to add collection parameter in one of the built-in reports. If you are looking to create your own report then you could do that with Report Builder.

How to add Collection parameter in SCCM report

As an example we will take a look at one of the report located under Software-Files > Computers with a specific file. This report displays a list of the computers where a specified file name appears in the software inventory, as well as information about inventoried files. We will first run this report to see how it looks. To run a report from the console select the required report, and either run the report using the Run icon, or right-click and select Run report . The report executes, and the results appear in a separate dialog. Now in the below screenshot you can see that report generates results of computers when specified file name appears in Software Inventory. It would be great if we can add the collection parameter here so that we can specify the file name and choose the collection so that results are filtered based on specified collection.

How to add Collection parameter in SCCM report

So before we modify report, lets make a copy of the original report. Edit the original report and in the report builder, click on the top left corner on the orange bubble. Click Save As.

How to add Collection parameter in SCCM report

Provide a name to the report such as Computers with a specific file with Collection. Click Save.

How to add Collection parameter in SCCM report

Now in the console, right click on the report that we just created, click on Edit.

How to add Collection parameter in SCCM report

Right click on the Datasets and click on Add Dataset. Let the Name of the dataset be default one. Click Use a dataset embedded in my report. Add the Data Source and under the query, add the line select CollectionID, Name from v_Collection Order by Name. Click OK. Just remember the dataset name as we will need in next steps.

How to add Collection parameter in SCCM report

Next we will add a new parameter to the report. Right click on Parameters and click Add Parameter. Specify a name to this parameter let’s call it “Collection“, Under the Prompt type the name as “Select a Collection”, the same name will be displayed in the reports. Select the Data type as Text, Set parameter viability to Visible.

How to add Collection parameter in SCCM report

Under Available Values, Select Dataset as “Dataset1” (this is the dataset that you just created in the previous step), set Value field as CollectionID and Label field as “Name” and click OK.

How to add Collection parameter in SCCM report

This is an important step. Right click on the Dataset0 and click Dataset Properties. You will see query at the bottom, you need to add the following lines to it.

 

If you add the above 2 lines at the end of query you might see a query properties window which means the query is incorrect. So the hint here is add the JOIN statements first and then add the WHERE statements. Click on OK.

In my case the final query was –

How to add Collection parameter in SCCM report

Save the report. Now when you run the report you will see the option to select a collection and by clicking on Values you can specify a collection.

How to add Collection parameter in SCCM report

  • Barkah Waelah

    Nice post..

    I browsing a reference to add “Collection Name” field into report? So it can present all computers with the members of each collection in one report. I have not found a good reference..

  • amiriano

    hi nice job dude,i had a question.i have a customized report for my hardware inventory.i want to add a collection prompt like you.how can i do that?in simple word i want to restrict my result to specific collection

  • Dan

    Hi Prajwal –

    I need some assistance ASAP. I am try to run a report for our upcoming Windows 10 upgrade. I am using the SCCM Built-In Report “Operating System requirement status for computers in a specific collection” under the Upgrade Assessment folder. This will show me what computers are eligible to upgrade to Windows 10.

    I need an additional 2 columns to the report that will show the User Name of the person using the computer and what department they fall under. How can I add this to the report results? Please someone help me!. Thank you so much

  • Dan

    Hi Prajwal –

    I need some assistance ASAP. I am try to run a report for our upcoming Windows 10 upgrade. I am using the SCCM Built-In Report “Operating System requirement status for computers in a specific collection” under the Upgrade Assessment folder. This will show me what computers are eligible to upgrade to Windows 10.

    I need an additional 2 columns to the report that will show the User Name of the person using the computer and what department they fall under. How can I add this to the report results? Please someone help me!. Thank you so much

  • Dan

    Hi Prajwal –

    I need some assistance ASAP. I am try to run a report for our upcoming Windows 10 upgrade. I am using the SCCM Built-In Report “Operating System requirement status for computers in a specific collection” under the Upgrade Assessment folder. This will show me what computers are eligible to upgrade to Windows 10.

    I need an additional 2 columns to the report that will show the User Name of the person using the computer and what department they fall under. How can I add this to the report results? Please someone help me!. Thank you so much

  • Dan

    Hi Prajwal –

    I need some assistance ASAP. I am try to run a report for our upcoming Windows 10 upgrade. I am using the SCCM Built-In Report “Operating System requirement status for computers in a specific collection” under the Upgrade Assessment folder. This will show me what computers are eligible to upgrade to Windows 10.

    I need an additional 2 columns to the report that will show the User Name of the person using the computer and what department they fall under. How can I add this to the report results? Please someone help me!. Thank you so much