Hello,
Trying to create a report for two requests:
- Per department (Collection)
- Per Product
I created a data source “Software Installed”
Then Three datasets
----------------------------------------------------------------------------------------------------------------------
1. Collection:
- CollectionID
- CollectionName
Query:
SELECT v_Collections.CollectionID ,v_Collections.CollectionName FROM v_Collections
ORDER BY v_Collections.CollectionName
----------------------------------------------------------------------------------------------------------------------
2. CollectionMembership:
- CollectionID
- ResourceID
Query:
SELECT v_FullCollectionMembership.CollectionID,v_FullCollectionMembership.ResourceID
FROM v_GS_INSTALLED_SOFTWARE
INNER JOIN v_FullCollectionMembership
ON v_GS_INSTALLED_SOFTWARE.ResourceID = v_FullCollectionMembership.ResourceID
Parameter:
----------------------------------------------------------------------------------------------------------------------
3. SoftwareInstalled:
- Product_Name
- Publisher
- Version
- Instance_count
Query:
(Select
/* ISS - All Workstations */
ProductName0 as [Product Name], Publisher0 as [Publisher], MAX(ProductVersion0) as [Version], count( distinct ResourceID) as [Instance Count], SoftwarePropertiesHash0 as [Software Properties Hash] from v_GS_INSTALLED_SOFTWARE v_GS_INSTALLED_SOFTWARE_Alias
where v_GS_INSTALLED_SOFTWARE_Alias.ProductName0 IS NOT NULL
and v_GS_INSTALLED_SOFTWARE_Alias.ResourceID IN (
select distinct v_FullCollectionMembership_Alias.ResourceID
from v_FullCollectionMembership v_FullCollectionMembership_Alias
inner join v_R_System_Valid v_R_System_Valid_Alias
ON v_R_System_Valid_Alias.ResourceID = v_FullCollectionMembership_Alias.ResourceID
where CollectionID = @Collection)
and Publisher0 = 'Cisco Systems, Inc.'
and ProductName0 = 'Cisco AMP for Endpoints Connector'
group by
SoftwarePropertiesHash0,
Publisher0,
ProductName0)
----------------------------------------------------------------------------------------------------------------------
So now when entering the “CollectionName” on the first screen I would like to get the details of the products (so for now only Cisco System, Inc./Cisco AMP for Endpoint Connector) later I will try to add a parameter for the product as well..
CollectionID is the link between 1 & 2 then ResourceID is the link between 2 & 3.
For now the report runs but reports empty!!! I ran the queries in SQL and they have results....
Declare @collection varchar(10) Set @collection = 'UCP00020' (Select /* ISS - All Workstations */ ProductName0 as [Product Name], Publisher0 as [Publisher], MAX(ProductVersion0) as [Version], count( distinct ResourceID) as [Instance Count], SoftwarePropertiesHash0 as [Software Properties Hash] from v_GS_INSTALLED_SOFTWARE v_GS_INSTALLED_SOFTWARE_Alias where v_GS_INSTALLED_SOFTWARE_Alias.ProductName0 IS NOT NULL and v_GS_INSTALLED_SOFTWARE_Alias.ResourceID IN ( select distinct v_FullCollectionMembership_Alias.ResourceID from v_FullCollectionMembership v_FullCollectionMembership_Alias inner join v_R_System_Valid v_R_System_Valid_Alias ON v_R_System_Valid_Alias.ResourceID = v_FullCollectionMembership_Alias.ResourceID where CollectionID = @collection) and Publisher0 = 'Cisco Systems, Inc.' and ProductName0 = 'Cisco AMP for Endpoints Connector' group by SoftwarePropertiesHash0, Publisher0, ProductName0)
Any comment,
Thanks,
Dom
Security / System Center Configuration Manager Current Branch / SQL