Recently I was doing some content cleanup (mainly for images) in Configmgr 2012 R2 .I have found lot a images for each OS (windows 7,Windows 8 and Windows 8.1) with different versions ,especially for windows 10 .Before I delete ,I was looking for some default report to check if any of these old versions are used in any of the production or non production task sequences (there are many) ,but I could not find any such report to check. If I have one or two tasks sequences, I can go to the task sequence and look at reference tab to check if the image is used in the task sequence . So I thought of creating SSRS report to check particular image (this report can be used to check for any package,application,OSD,driver package etc) is used in what task sequences/or no task sequences, so that I can take a decision if the images can be deleted or not.
This report can be used to check any reference package used in what task sequence and then you can send email to the team with this information to check and revert back before you take any action .
When you run the SSRS Report,it will prompt to select the package type (application,Package,boot image,OS Image, OS Install package and driver package) followed by package name based on your selection of package type. This SSRS Report uses cascading parameters which means,prompt parameter depends on another prompt parameter that you choose.
Here is the SQL Query if you want to run from SQL Management studio:
select TP.name [TS Name],TP.packageID [TS ID],TP.Description,TP.sourcesite From v_TaskSequenceReferencesInfo TSR
inner join v_TaskSequencePackage TP on TP.PackageID=TSR.PackageID
inner join v_Package pkg on pkg.packageid=tsr.packageid
order by 1
Change the package ID to your respective content ID.
if you wanted to get list of applications,packages with package ID,Package Name,use the following SQL Query:
pkg.Name as [Package Name],
When 0 Then 'Software Distribution Package'
When 3 Then 'Driver Package'
When 4 Then 'Task Sequence Package'
When 5 Then 'software Update Package'
When 6 Then 'Device Settings Package'
When 8 Then 'Application'
When 7 Then 'Virtual Package'
When 257 Then 'Image Package'
When 258 Then 'Boot Image Package'
When 259 Then 'OS Install Package'
Else ' '
END AS 'Package Type',
from v_Package pkg
order by 2
Download the SSRS Report from Technet Gallery ,uploaded to your Configmgr reports folder ,change the Data source ,run the Report.
SSRS Report Cascading reference :https://msdn.microsoft.com/en-us/library/dd255197.aspx