Quantcast
Channel: Symantec Connect - Endpoint Management
Viewing all articles
Browse latest Browse all 7163

Inconsistent Reporting for Installed Applications

$
0
0
I need a solution

Hey all,  (fair warning, wall of text/query ahead)

New guy here, hoping someone here can point me in the right direction.  As a business, we started out small and have exploded (literally hiring hundreds of people over the course of a year), and during/prior to this most people typically had admin rights on their workstations.  Needless to say, this has all kind of problems associated with it, which we're finally addressing now and trying to standardize.  One of those things is standardizing the applications that are deployed out to user workstations, in which we're trying to get everyone out to the same versions of x and such.  In the example below I'm using textpad as a reference.  In this first section, this is a query that we're using to pull out some information (only the second half is relevant, but for the sake of what's available in this report, Name parameter would be Textpad%, and Version 5.3.1%, internal info blanked on SS ):

DECLARE @v1_TrusteeScope nvarchar(max)
SET @v1_TrusteeScope = N'%TrusteeScope%'

IF ('%Type%' = 'Managed Software')
SELECT spi.Guid
      ,spi.Name
      ,spv.[Version]
      ,company.Name AS Company
      ,cnt.cnt AS [Count]
FROM vRM_Software_Product_Item spi
JOIN
        (SELECT COUNT(DISTINCT inst._ResourceGuid) AS cnt,ra.ParentResourceGuid
         FROM ResourceAssociation ra
         JOIN Inv_InstalledSoftware inst
            ON inst._SoftwareComponentGuid = ra.ChildResourceGuid and InstallFlag = 1
         -- added 2013-03-15
         JOIN vComputer vc on vc.Guid = inst._ResourceGuid
            and vc.isManaged <> 0
         WHERE ra.ResourceAssociationTypeGuid = '9D67B0C6-BEFF-4FCD-86C1-4A40028FE483' --product contains component
         AND inst._ResourceGuid IN (SELECT ResourceGuid from ScopeMembership WHERE ScopeCollectionGuid IN(SELECT ScopeCollectionGuid FROM fnGetTrusteeScopeCollections (@v1_TrusteeScope)))
         GROUP BY ra.ParentResourceGuid 
         )cnt
   ON cnt.ParentResourceGuid = spi.[Guid]
JOIN Inv_Software_Product_State sps
   ON sps._ResourceGuid = spi.[Guid]
   AND sps.IsManaged = 1
LEFT JOIN Inv_Software_Product_Version spv
   ON spv._ResourceGuid = spi.[Guid]
LEFT JOIN (SELECT rc.Name, ra.ParentResourceGuid AS softProdGuid
           FROM RM_ResourceCompany rc
           JOIN ResourceAssociation ra
              ON ra.ChildResourceGuid = rc.[Guid]
              AND ra.ResourceAssociationTypeGuid = 'D5C66D5A-7686-4CA2-B7C1-AC980576CE1D')company
   ON company.softProdGuid = spi.[Guid]

WHERE ('%Name%' = '%' OR LOWER (spi.Name) LIKE LOWER ('%Name%'))
AND ('%Version%' = '%' OR spv.[Version] LIKE '%Version%')
AND ('%Company%' = '%' OR LOWER (company.Name) LIKE LOWER ('%Company%'))
AND spi.[CreatedDate] >= '%Discovered since%'
ORDER BY spi.Name

ELSE
IF ('%Type%' = 'All Software')
SELECT sci.[Guid]
       ,sci.Name
       ,sc.[Version]
       ,company.Name AS [Company]
       ,inst.cnt AS [Count]
FROM vRM_Software_Component_Item sci
JOIN Inv_Software_Component sc
   ON sci.Guid = sc._ResourceGuid
JOIN (SELECT COUNT(DISTINCT _ResourceGuid) AS cnt, _SoftwareComponentGuid
      FROM Inv_InstalledSoftware inst
      -- added 2013-03-15
      JOIN vComputer vc on vc.Guid = inst._ResourceGuid
          and vc.isManaged <> 0
      WHERE InstallFlag = 1
      AND _ResourceGuid IN (SELECT ResourceGuid from ScopeMembership WHERE ScopeCollectionGuid IN(SELECT ScopeCollectionGuid FROM fnGetTrusteeScopeCollections (@v1_TrusteeScope)))
      GROUP BY _SoftwareComponentGuid)inst
   ON inst._SoftwareComponentGuid = sci.Guid
LEFT JOIN (SELECT ra.ParentResourceGuid AS sofCompGuid, rc.Name
           FROM RM_ResourceCompany rc
           JOIN ResourceAssociation ra
              ON ra.ChildResourceGuid = rc.Guid
              AND ra.ResourceAssociationTypeGuid = '292DBD81-1526-423A-AE6D-F44EB46C5B16')company
   ON company.sofCompGuid = sci.Guid
WHERE ('%Name%' = '%' OR LOWER (sci.Name) LIKE LOWER ('%Name%'))
AND ('%Version%' = '%' OR sc.[Version] LIKE '%Version%')
AND ('%Company%' = '%' OR LOWER (company.Name) LIKE LOWER ('%Company%'))
AND sci.[CreatedDate] >= '%Discovered since%'
ORDER BY sci.Name

Installed Software Search.png

Now, where the conflict arises is where I'm seeing different things than what are showing up in this report, below is the drill down on that particular result (other lines blanked):

180px_Drilldown No.png

If you'll notice, the machine that shows up in the Drill down is showing in this report as having 5.3.1, yet when you open the resource manager from that computer object in Manager > Computers (see in the first screenshot), you can clearly see that the true installed version is 7.4.0.  Now, I've written a separate query that seems to pull more accurate results as to what's out in the field (PS, I hate joins, just find them annoying to read):

SELECT
 vc.[Guid],
 vc.[Name],
 u.[Display Name],
 arp.[DisplayName],
 arp.[DisplayVersion]
FROM
 vComputer vc,
 vassetuserowner auo,
 vuser u,
 Inv_AddRemoveProgram arp,
 Inv_AeX_AC_Identification ACIdentity
WHERE
 vc.[Guid] = ACIdentity.[_ResourceGuid] AND
 vc.[Guid] = ARP.[_ResourceGuid] AND
 vc.[Guid] = auo.[_AssetGuid] AND
 auo.[_uGuid] = u.[Guid] AND

 ARP.[DisplayName] LIKE N'Textpad%' AND
 ARP.[DisplayVersion] LIKE N'5.3.1' AND
 InstallFlag = 1 AND
 vc.[isManaged] = 1

Upon running this query, it only two results where the information appears to be accurate.

I would say I'll just use this last one going forward, but, when I go into manage / software, and look at the software product and sort by versions, I see it reporting 9 inventory.

SoftwareManage.png

I have suspicions that it may be a view or something that's not updating properly, however not quite sure where to look from here.  Any one have some tips to make sure everything is reporting in correctly?

-Aaron


Viewing all articles
Browse latest Browse all 7163

Trending Articles