Client Management Suite

 View Only
  • 1.  Inventory report for machines with installed Windows hotfix

    Posted Jan 25, 2012 08:41 AM

    Hi,

    I'm trying to run an SQL query to find machines where a certain hotfix is installed.  In this case, the Hotfix is registered in Add/Remove Programs (and on 2008 under the Installed Updates section of Programs in the Control Panel).

     

    Here is what it looks like:

     

    Now, I am using this query:

     

     

    DECLARE @v1_TrusteeScope nvarchar(155)
       SET @v1_TrusteeScope = N'{0EA12B74-3C84-40ED-B2BA-E1932B5C1151},{2E1F478A-4986-4223-9D1E-B5920A63AB41},{582029E2-FC5B-4717-8808-B80D6EF0FD67},{B760E9A9-E4DB-404C-A93F-AEA51754AA4F}'
    SELECT
       [vri2_Computer].[Guid] AS [_ItemGuid],
       [vri2_Computer].[Name],
       [dca3_AddRemoveProgram].[DisplayName],
       [dca3_AddRemoveProgram].[DisplayVersion]
    FROM
       [vRM_Computer_Item] AS [vri2_Computer]
          LEFT OUTER JOIN [Inv_AddRemoveProgram] AS [dca3_AddRemoveProgram]
             ON ([vri2_Computer].[Guid] = [dca3_AddRemoveProgram].[_ResourceGuid])
    WHERE
       (
          (
             (
                ([dca3_AddRemoveProgram].[DisplayName] LIKE N'%hotfix%')
             )
          )
          AND
          ([vri2_Computer].[Guid] IN (SELECT [ResourceGuid] FROM [ScopeMembership] WHERE [ScopeCollectionGuid] IN (SELECT [ScopeCollectionGuid] FROM dbo.fnGetTrusteeScopeCollections(@v1_TrusteeScope))))
       )
     
    I get many results for add/remove programs entries, but none for this particular hotfix.  Try as I might, no matter how I word it within the %'s, I get no hits, but I get hits on other hotfixes, like I said.
     
    What am I missing?  Is this information stored in another place in the database?
     
    Thanks!


  • 2.  RE: Inventory report for machines with installed Windows hotfix

    Posted Jan 25, 2012 11:19 AM

    Add/Remove looks at the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall portion of the registry. Updates were there prior to Windows 7/Server 2008.  In Windows 7/Server 2008, the registry location is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Updates, which is not captured in Inv_AddRemoveProgram.

    Why are you not using Patch Management for a compliance report?  I recommend using a patch management compliance report, since your clients are already reporting their vulnerability and compliance data for Windows.



  • 3.  RE: Inventory report for machines with installed Windows hotfix

    Posted Jan 25, 2012 02:06 PM

    I cannot find this hotfix in patch compliance because it is a standalone hotfix and was not released through Windows Update / Altiris Patch Management patch catalogue.  So, am I stuck with having to do a custom inventory?



  • 4.  RE: Inventory report for machines with installed Windows hotfix

    Posted Jan 26, 2012 10:35 PM
    Yep custom inventory to populate the registry key is going to be your ticket home on this one. Are the machines mostly on 7/2008 or xp/2003? I'll help you write it... Just need to know wether powershell or vbscript :)


  • 5.  RE: Inventory report for machines with installed Windows hotfix

    Posted Feb 01, 2012 02:28 PM

    Server 2008!  I appreciate this.



  • 6.  RE: Inventory report for machines with installed Windows hotfix

    Posted Feb 02, 2012 11:22 PM

    Do you happen to have the registry information available for this hotfix? I don't know it off hand.. I can write the script and point you in the right direction or I can just plug it in for you... I need to know the type (string, dword, expanded string) and the name...

    Happen to have these handy?



  • 7.  RE: Inventory report for machines with installed Windows hotfix

    Posted Feb 02, 2012 11:34 PM

    This should get you started:

     

    First off -

    Go and create a new Data class with 2 attributes, name them whatever you want. You can set more than three if you like but you'll need to adjust the script below to add 3 rows of data rather than two. 

    Change the guid(highlighted in bold) in the script below to the guid of your newly created Data Class

    Create a run script task with the vbscript below in it (edit to your liking first)

    Run on all machines and they will populate the data into the new data class

     

     

     
    '---------------------BEGIN CUSTOM SCRIPT FOR INFORMATION GATHERING-----------
    const HKEY_CURRENT_USER = &H80000001
    const HKEY_LOCAL_MACHINE = &H80000002
    strComputer = "."
    Set StdOut = WScript.StdOut
     
    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
     strComputer & "\root\default:StdRegProv")
      
     
    strKeyPath = "SOFTWARE\Microsoft\Windows Script Host\Settings"
    strValueName = "DisplayLogo"
    oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
    '----------------------END CUSTOM SCRIPT FOR INFORMATION GATHERING------------
    '----------------------NOTIFICATION SERVER ENTRY STARTS HERE------------------
    dim nse
    set nse = WScript.CreateObject ("Altiris.AeXNSEvent")
    nse.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}" 'Never change this guid, it is needed by NS.
    nse.Priority = 1
    dim objDCInstance
    set objDCInstance = nse.AddDataClass ("{8752a5ab-ed0a-4db5-9ac3-7d21a632900c}") ' Change this to math the guid of the custom data class
    dim objDataClass
    set objDataClass = nse.AddDataBlock (objDCInstance)
    dim objDataRow
    set objDataRow = objDataClass.AddRow
    objDataRow.SetField 0, strValueName
    objDataRow.SetField 1, strValue
    nse.SendQueued
    '----------------------NOTIFICATION SERVER ENTRY ENDS HERE---------------------
     
     
    Let me know if you need help with it!