Below is the query present inside Computers with Software installed report in our console. For a certain software, the installed count in our environment is 14000 but while selecting the same software by running this report in console returns only 500.Could someone help me in modifying the report so that it can return proper results.
Declare @ProductUsage Table(
ResourceGuid varChar(36)
,Name varChar(36)
,[OS Name] varChar(36)
,UsedCount int
,DeliveryStatus varChar(36)
,SoftwareComponentGuid varChar(36)
,[Software Name] nvarchar(128)
,LastStart DateTime
,InstallDate DateTime
)
INSERT @ProductUsage
EXECUTE spAC_GetComputersBySoftwareProduct @ComputerName=N'%%'
, @SelectTop=20
, @Trustee=N'{2E1F478A-4986-4223-9D1E-B5920A63AB41},{402DC8EC-CC6C-4D4B-B389-F12AE18CB02F},{582029E2-FC5B-4717-8808-B80D6EF0FD67},{9791A53A-6F81-4701-B878-E68C4C540057},{A8508E1D-C6A5-4F9B-A1F4-3D401C44564D},{AE41E526-1963-4C40-A456-A67E845F4D19},{B760E9A9-E4DB-404C-A93F-AEA51754AA4F}'
, @SoftwareComponentGuids='%DesiredComponentGuid%'
Select
PU.Name
,PU.[OS Name]
,PU.[Software Name]
,PU.UsedCount
,PU.LastStart
,SwINV.Usage
,SWInv.[Usage Previous Month]
,PU.InstallDate
from @ProductUsage PU
JOIN ( Select Inv._ComputerResourceGuid
,inv.Usage
,inv.[Usage Previous Month]
,itm.Name
from
dbo.Inv_SoftwareProduct_InstallationInfo INV
JOIN dbo.vItem itm ON itm.Guid=inv._ResourceGuid
where itm.Guid = '%DesiredComponentGuid%' and itm.ClassGuid = 'AA34B7C1-1C65-4085-A9D1-E7F83D633B2F'
Group By Inv._ComputerResourceGuid ,inv.Usage, inv.[Usage Previous Month],itm.Name) as SwINV ON PU.ResourceGuid = SWINv._ComputerResourceGuid