SCCM Report – All Packages, Programs and their command lines

Hi all,

I recently had a requirement at a client to make a list of all SCCM Packages. their Programs,  and then the command lines of each, along with the package source.  I wondered if this was possible, and fortunately the SQL Views were already present to do so.

This ended up being a very short query:

SELECT Program.PackageID,
Package.Name 'Package Name',
Program.ProgramName 'Program Name',
FROM [v_Program] as Program
LEFT JOIN v_Package as Package on Package.PackageID = Program.PackageID</p>
Order by Program.PackageID

And the output  Some of these command lines were VERY long, so it came out a bit wide.:

apps and command lines - 1 apps and command lines - 2


11 thoughts on “SCCM Report – All Packages, Programs and their command lines

  1. Chris August 18, 2014 / 7:58 pm

    Do you happen to know how to modify this report to include the package hash value as well? I was trying to resolve hash value mismatch issues on my DP’s and came across the SQL query at the bottom of this article:, but it requires the package ID to be entered one at a time and uses the SQL management studio. I would love to have a report viewable from the SCCM console that includes the information in your report and also includes the hash value so I can match it against the values calculated by the hashdir tool.

    • FoxDeploy August 20, 2014 / 10:14 am

      Sure thing Chris. I have my SCCM config mothballed at home and can’t get to it at the moment.

      Can you give me a screen shot from SQL Management Studio of the table which has the column you want (hash value)? If you do, I can help you update the query I provided to give you the info you need.

  2. Mat October 15, 2014 / 12:10 pm

    Thanks for that Query! Really helped me out!

    • FoxDeploy October 15, 2014 / 12:25 pm

      Happy to help. Feel free to shoot me query requests in the future. I think it is really a fun challenge to pull out the perfect info with a query.

  3. ez12a October 28, 2014 / 3:37 am

    Great query! I thought it’d be a good idea to archive this information for future use. Would you be able to make one for Applications and their Deployment Types that include their command line? (I see this seems to only do Packages)

  4. ez12a October 28, 2014 / 3:38 am

    Thanks for the helpful script. Would you be able to do the same for Applications and their Deployment Types (and their ‘Command Line’)? I see this query only returns Packages. That would be awesome!

  5. David McKinnon January 15, 2016 / 12:47 pm

    Hi Steve – is it possible to get the deployment counts for each package followed be a grand total of deployments for all packages? Thanx, Dave

  6. TL February 7, 2017 / 7:03 pm

    Thank you very much for the script. Can you provide guidance with a sql script that shows which PackageID is linked to a CollectionID? Also, one that shows a Packages Programs and there related CollectionIDs?

    Example: We use sccm packages instead of applications. Each Package could have several programs (one for each business location) and each program is associated with its own collection. How can I query all packageid, associated programs and related collections in a single query?

    Thank you very much for your assistance!!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s