Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SCCM Report All Installed Software

Posted on 2010-07-21
9
Medium Priority
?
21,456 Views
Last Modified: 2014-11-13
I have an audit comming up and I would like to create a custom dash board for the auditors.  This way they could find the info that they are looking for direclty.  

One of the reports that we will be giving them is the Count of all instances of software registered with Add or Remove Programs.  The problem with this report is that it prompts you to enter in the group that you would like to run it against.  This does not work for dashboards.  

I want to copy the report and change the sql query in order to give it the name of the group as opposed to prompting for it.  

I cannot figure out how to do this.  I will copy the code bellow and the group I want to run it against is Collection ID SMS000ES.  If someone could help and explain what they are doing, I hopefully will be able to grasp this and apply it to other reports that they will want.  

Thanks
SELECT DisplayName0, Count(*) AS 'Count', Publisher0, Version0, @CollID as CollectionID
FROM v_Add_Remove_Programs arp
JOIN v_FullCollectionMembership fcm on arp.ResourceID=fcm.ResourceID 
WHERE fcm.CollectionID = @CollID
GROUP BY DisplayName0, Publisher0, Version0 
ORDER BY Publisher0, Version0

Open in new window

0
Comment
Question by:tdisalvo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 3

Assisted Solution

by:socrates2012
socrates2012 earned 200 total points
ID: 33258286
From the SQL edit screen look to the right and you will see a Prompts button.  Clicking it will show you the variable for CollID and side query used to look up those values.  If you want to just hardcode in a particular collection you can delete that prompt and then here is the fixed SQL query:

 SELECT DisplayName0, Count(*) AS 'Count', Publisher0, Version0, @CollID as CollectionID
FROM v_Add_Remove_Programs arp
JOIN v_FullCollectionMembership fcm on arp.ResourceID=fcm.ResourceID
WHERE fcm.CollectionID = SMS000ES
GROUP BY DisplayName0, Publisher0, Version0
ORDER BY Publisher0, Version0
 
0
 
LVL 3

Expert Comment

by:socrates2012
ID: 33258295
Oops, remove the "@CollID as CollectionID" from the SELECT line too
0
 

Author Comment

by:tdisalvo
ID: 33258789
OK, I made the adjustments as listed and we are now getting the following error.  I did remove the Prompt as well and that part did work.  

An error occurred when the report was run. The details are as follows:
Invalid column name 'SMS000ES'.
Error Number: -2147217900
Source: Microsoft OLE DB Provider for SQL Server
Native Error: 207

I will copy the code bellow

SELECT DisplayName0, Count(*) AS 'Count', Publisher0, Version0, 
FROM v_Add_Remove_Programs arp
JOIN v_FullCollectionMembership fcm on arp.ResourceID=fcm.ResourceID 
WHERE fcm.CollectionID = SMS000ES
GROUP BY DisplayName0, Publisher0, Version0 
ORDER BY Publisher0, Version0

Open in new window

0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 3

Expert Comment

by:socrates2012
ID: 33259417
May want to verify that the collection you are trying to run this report against is truly called SMS000ES.  Right click on the collection and view properties.  Rename in the query accordingly.
0
 

Author Comment

by:tdisalvo
ID: 33260489
Nope defiantly SMS000ES.  Any other thoughts?  Your help is defiantly appreciated.  
1.jpg
0
 
LVL 3

Expert Comment

by:socrates2012
ID: 33260521
Put single, possibly double, quotes around the collection ID name.
0
 
LVL 29

Accepted Solution

by:
matrixnz earned 800 total points
ID: 33289821
Hi tdisalvo

You must declare the @CollID as this is a linked report, remove the prompt as socrates suggested and then use the following in your SQL Query.

Cheers
Declare @CollID char(8)
Set @CollID = 'SMS000ES'

SELECT DisplayName0, Count(*) AS 'Count', Publisher0, Version0, @CollID as CollectionID
FROM v_Add_Remove_Programs arp
JOIN v_FullCollectionMembership fcm on arp.ResourceID=fcm.ResourceID 
WHERE fcm.CollectionID = @CollID
GROUP BY DisplayName0, Publisher0, Version0 
ORDER BY Publisher0, Version0

Open in new window

0
 

Author Closing Comment

by:tdisalvo
ID: 33327745
Big thanks to everyone for helping me out.  
0
 
LVL 1

Expert Comment

by:tyconz_helpdesk2008
ID: 40441571
Hi
How would i add netbios name as well to the report above

thanks in advance
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Know what services you can and cannot, should and should not combine on your server.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question