Client Management Suite

 View Only
  • 1.  Inconsistent Reporting for Installed Applications

    Posted Mar 18, 2015 03:04 PM

    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



  • 2.  RE: Inconsistent Reporting for Installed Applications

    Posted Mar 20, 2015 01:31 PM

    Does these queries produce similar results?  You may need to change the where clauses to match your search.  The first one is using the installed software data class and the second is displaying Add/Remove Programs data class which can have slightly different results.  I think the installed software can contain more information because it searches more items (registry, MSI, ...).

    SELECT sci.[Guid]

    ,sci.Name

    ,sc.[Version]

    ,cmp1.Name AS [Company]

    , is1.[Source]

    ,c1.Name AS 'Computer'

    FROM vRM_Software_Component_Item sci

    JOIN Inv_Software_Component sc ON sci.Guid = sc._ResourceGuid

    JOIN Inv_InstalledSoftware is1 ON is1._SoftwareComponentGuid = sci.Guid

    and is1.InstallFlag = 1

    join ResourceAssociation cmp1_ra on sci.Guid = cmp1_ra.ParentResourceGuid

    join vRM_Company_Item cmp1 ON cmp1_ra.ChildResourceGuid = cmp1.Guid

    join vRM_Computer_Item c1 on is1._ResourceGuid = c1.Guid

    WHERE sci.Name like 'Textpad%'

    and SC.[Version] like '5.3.1%'

     

     

     

    SELECT ARP1.DisplayName

    , ARP1.DisplayVersion

    ,c1.Name AS 'Computer'

    FROM Inv_AddRemoveProgram ARP1

    join vRM_Computer_Item c1 on ARP1._ResourceGuid = c1.Guid

    WHERE ARP1.DisplayName like 'Textpad%'

    and ARP1.DisplayVersion like '5.3.1%'

    AND ARP1.InstallFlag = 1

     

    • you could try running a full inventory against one of the clients.
    • If the data persists, you can delete the entry from the database and allow it to repopulate.  Once complete recheck the data.

     



  • 3.  RE: Inconsistent Reporting for Installed Applications

    Posted Mar 20, 2015 05:04 PM

    When I made the policy it basically ran an uninstall of 5.3.1, installed 7.4.0, then did a full inventory right after the fact.  Unfortuantely that didn't result in success and still showed inconsistent data.  The first query however, after waiting a few days, did finally seem to come back down to an accurate number, however for the count in software product, it never did adjust.  I deleted the software resource and will allow it to repopulate, and see what happens then.  Happen to know what query it's running to pull that information from the software product view that I can compare against?  Also out of curiosity, the software data class, isn't information here populated from the add remove programs data class?

    We'll be migrating to 7.6 later this year (currently on 7.1) so it will be a good opportunity to clean up the database, just trying to understand exactly how it's pulling this info.



  • 4.  RE: Inconsistent Reporting for Installed Applications

    Posted Mar 23, 2015 08:48 AM

    Here is what I've experienced related to your situation.

    There are known issues with inventory updating when software no longer existing on a computer.  there can be a few resolutions.  One is perfoming a full inventory which has some success.  Another is clearing the datahash which has little success.  The last is deleting the computer resource and perfoming a full inventory which has been successful.  The known issue was fixed in a hot fix, but it didn't resolve existing entries; support instructed me to delete computer entries.

     

    It has been some time since I worked with the Software Catalog and software products.  I think it is the query below which is used to populate the Software components related to the software products and user entered criteria.  I used the SQL profiler to capture the query.  I'm not sure how the default Software products get created, but the manually created ones store the user created creteria in teh database and these are plugged into one of the full

    SELECT component.Guid
    ,component.Name
    ,component.ResourceTypeGuid
    ,scVersion.Version
    ,company.Name As CompanyName
    ,company.Guid AS CompanyGuid
    ,inst.Installs
    ,swState.IsManaged
    FROM vRM_Software_Component_Item component
    JOIN (Select COUNT(DISTINCT _ResourceGuid) as Installs, _SoftwareComponentGuid FROM Inv_InstalledSoftware Where InstallFlag = 1 Group By _SoftwareComponentGuid) as inst ON inst._SoftwareComponentGuid = component.Guid
    LEFT JOIN Inv_Software_Component_State swState ON swState._ResourceGuid = component.Guid --MODIFIED
    --JOIN Inv_Software_Component_State swState ON swState._ResourceGuid = component.Guid --ORIGINAL

    LEFT JOIN (SELECT vci.Guid, vci.Name, ra.ParentResourceGuid AS ComponentGuid
    FROM vRM_Company_Item vci
    JOIN ResourceAssociation ra
    ON ra.ChildResourceGuid = vci.Guid
    AND ra.ResourceAssociationTypeGuid = '292dbd81-1526-423a-ae6d-f44eb46c5b16'
    ) company
    ON company.ComponentGuid = component.Guid
    LEFT JOIN Inv_Software_Component scVersion
    ON scVersion._ResourceGuid = component.Guid
    Where (swState._ResourceGuid  is null or Lower(component.Name) = 'Windows Server 2008 R2 Standard x64' ) and company.Name = 'microsoft'
    Order By component.Name Asc

     

    The inv_Installedsoftware data class is based on Add/Remove Programs, MSI and Targetted Software Inventory (and maybe some other stuff).  The inv_AddRemoveprograms dataclass is based on Add/Remove Programs (one can use CIM studio to view client WMI data).

    Technotes on Installed Software; there are others, but I couldn't find them

    http://www.symantec.com/business/support/index?page=content&id=TECH182567&actp=search&viewlocale=en_US&searchid=1409325871039

    http://www.symantec.com/business/support/index?page=content&id=TECH141512&actp=search&viewlocale=en_US&searchid=1409323251111

    http://www.symantec.com/business/support/index?page=content&id=TECH223257&actp=search&viewlocale=en_US&searchid=1427114032913

     

    I would first verify inventory is reporting without error by deleting an affected computer resource and running a full inventory.  If the incorrect software entry still appears, I would see what the Source column in the inv_installedsoftware table shows for the source.  I would also verify the entry is not listed in the Add/Remove Programs WMI class shown on the computer.  I use CIM Studio to view client WMI data.



  • 5.  RE: Inconsistent Reporting for Installed Applications

    Trusted Advisor
    Posted Mar 23, 2015 12:51 PM

    Not sure if it's helpful, but I've seen full inventory not correctly remove software (prior to 7.5).  Support said it's a known issue and I should run this script every so often to delete software cache file so correct installed info gets into CMS

    if exist "C:\Program Files\Altiris\Altiris Agent\Agents\SoftwareManagement\data\softwarecache.xml" del "C:\Program Files\Altiris\Altiris Agent\Agents\SoftwareManagement\data\softwarecache.xml"
     
    I had it set to run as a policy every 2 weeks or so - but turned it off when I upgraded to 7.5 which seemed to resolve the issue for me.