www.fgks.org   »   [go: up one dir, main page]

 none
WMI query for ProductsUninstall returns wrong results

    Question

  • Hi,

    While trying to find all instances of "Microsoft Visual Studio 2012 Professional" in the domain, I noticed the results recorded in the ProductsUninstall table, in displayname, all read "Microsoft Visual Studio 2010 Ultimate - ENU"

    The same happens in [Win_Inventory].[Products]

    Results for other applications seem fine but suspicion is in the air now..

    select  
      pu.displayname
    , pu.productcode
    , pu.displayversion
    , pu.installdate
    , pu.installlocation
    , dv.DeviceNumber
    , dv.addnshostname
    , dv.computerSystemName
    , dv.dnshostname
    , dv.enclosuremanufacturer
    , dv.model 
    , dv.VmFriendlyName
    , dv.operatingsystem
    , dv.operatingsystemservicepack
    , dv.osarchitecture
    , dv.oscaption
    , dv.osinstalldate
    , dv.roles
    , dv.username
    , ad.*
    FROM [Win_Inventory].[ProductsUninstall] pu
    inner join core_inventory.devices dv
    ON pu.DeviceNumber = dv.DeviceNumber
    inner join Core_Inventory.AdDiscoveredDevices ad
    ON pu.DeviceNumber = ad.DeviceNumber
    WHERE pu.displayname like 'Microsoft visual studio 2%'

    Monday, March 11, 2013 8:53 PM

Answers

  • Given the query you used, you are right to be suspicious. Luckily, MAP does not use the same query :)

    If programs create the necessary registry entries when installed and therefore would show up in the Programs and Features (Add/Remove Programs) list then MAP should also show them. MAP gets the list of installed programs from the following registry entries:

    MAP fills the ProductsUninstall table with entries from these registry keys:

    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*
    • HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*
    • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\*
    • HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*

    It also fills the products table with entries from these registry keys:
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\installer\UserData\*\Products\*\InstallProperties

    MAP will show everything from the ProductsUninstall table with SystemComponent != 1 and without ParentDisplayName or ParentKeyName. (This results in the same list that ARP shows). In addition, we show items from the products table that don't have corresponding entries in the ProductsUninstall table.

    In addition, MAP could potentially inventory the same machine multiple times depending on the discovery methods used. These duplicate values may exist in a few of the tables, but that doesn't mean that MAP is using both of those values in the assessments. Part of the de-duplication process is the updating of the table [Core_Assessment].[UniqueDevices].

    When MAP creates the data sets for the reports and the UI, it uses this table as a filter to make sure it is only reporting unique devices.

    Currently, MAP creates a checksum hash by coalescing these data points to determine if a device is a duplicate of another machine:

    • MAC address (from the Win32_NetworkAdapterConfiguration WMI class)
    • BIOS serial number (from the Win32_BIOS WMI class)
    • Product ID (from the Win32_WindowsProductActivation WMI class)
    • Serial Number (from the Win32_OperatingSystem WMI class)

    So, as you can see, MAP uses a few different methods to weed out any duplications that may occur.



    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. Please VOTE as HELPFUL if the post helps you. This can be beneficial to other community members reading the thread.

    Monday, March 11, 2013 9:54 PM
    Moderator

All replies

  • Given the query you used, you are right to be suspicious. Luckily, MAP does not use the same query :)

    If programs create the necessary registry entries when installed and therefore would show up in the Programs and Features (Add/Remove Programs) list then MAP should also show them. MAP gets the list of installed programs from the following registry entries:

    MAP fills the ProductsUninstall table with entries from these registry keys:

    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*
    • HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*
    • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\*
    • HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*

    It also fills the products table with entries from these registry keys:
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\installer\UserData\*\Products\*\InstallProperties

    MAP will show everything from the ProductsUninstall table with SystemComponent != 1 and without ParentDisplayName or ParentKeyName. (This results in the same list that ARP shows). In addition, we show items from the products table that don't have corresponding entries in the ProductsUninstall table.

    In addition, MAP could potentially inventory the same machine multiple times depending on the discovery methods used. These duplicate values may exist in a few of the tables, but that doesn't mean that MAP is using both of those values in the assessments. Part of the de-duplication process is the updating of the table [Core_Assessment].[UniqueDevices].

    When MAP creates the data sets for the reports and the UI, it uses this table as a filter to make sure it is only reporting unique devices.

    Currently, MAP creates a checksum hash by coalescing these data points to determine if a device is a duplicate of another machine:

    • MAC address (from the Win32_NetworkAdapterConfiguration WMI class)
    • BIOS serial number (from the Win32_BIOS WMI class)
    • Product ID (from the Win32_WindowsProductActivation WMI class)
    • Serial Number (from the Win32_OperatingSystem WMI class)

    So, as you can see, MAP uses a few different methods to weed out any duplications that may occur.



    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. Please VOTE as HELPFUL if the post helps you. This can be beneficial to other community members reading the thread.

    Monday, March 11, 2013 9:54 PM
    Moderator
  • Hello Michael, thank you for your reply.

    The query I used was an example of my attempt, so you could better understand what I'm after. I could extend the filter with the same clauses as MAP.

    I still don't understand. Are you saying that the problem is me selecting raw data and not understanding the additional corrections done by MAP?

    If I'm joining the core_inventory.devices, that should assure me the link to the correct device, even if it's duplicate. This is not a variable in my goal.

    What is a fact is that, most of my domain workstations have VS2012 installed and MAP table is showing VS2010. My workstation is one of them so it was easy to catch this.

    Would appreciate your help.

    Monday, March 11, 2013 10:12 PM
  • Please ignore. I'll use the view instead [UT_WinServer_Reporting].[InstalledProductsView]

    Thank you.

    Monday, March 11, 2013 10:50 PM
  • Sorry about that, I didn't mean any offense. I thought the issue you had was that you were seeing duplications, which would be possible from your query. Upon re-reading the original post, I see that it was not that there were duplicates, but that you are not seeing VS 2012, but VS 2010 instead. I read that too quickly it would seem.

    When did you install VS 2012 and did you have VS 2010 installed previously? Once MAP captures data, it does not 'refresh' that data on subsequent runs, you have to go to File > Select Database and create a new one in order for any changes to show up.

    Can you try this query?

    select gupr.[DeviceNumber] AS [MAPDeviceGUiD], 
          gupr.[ComputerName] AS [ComputerName],
           gupr.[Name] AS [ProductName], 
           gupr.[ProductVersion] AS [ProductVersion],
           [UT_WinServer_Reporting].[_GetProductEditionForDisplay]('en', [UT_WinServer_Reporting].[_GetProductEdition](gupr.[DeviceNumber])) AS [ProductEdition],
           gupr.[ProductVendor] AS [ProductVendor],
           hi.[CurrentOperatingSystem] AS [OperatingSystem],
           [UT_ActiveDaU_Reporting].[GetUsersCurrentLogon](gupr.[DeviceNumber], 'en') AS [ActiveUsers],
           hi.[MachineType] AS [TypeOfMachine], 
           [AllDevices_Assessment].[_GetDeviceNameForDisplay](va.[HostDeviceNumber]) AS [HostMachineName],
           hi.[NumberOfProcessors] AS [CountOfProcessors], 
           hi.[NumberOfCores] AS [CountOfTotalCores], 
           hi.[NumberOfLogicalProcessors] AS [CountOfLogicalProcessors]
    from [UT_WinServer_Reporting].[GetProductsResults]() gupr
    INNER JOIN [AllDevices_Assessment].[HardwareInventory] hi
    ON gupr.[DeviceNumber] = hi.[DeviceNumber]
    LEFT OUTER JOIN [AllVirt_Assessment].[VirtualizationAssessment] va
    ON va.[DeviceNumber] = gupr.[DeviceNumber]
    where gupr.[Name] like '%Visual Studio%'



    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. Please VOTE as HELPFUL if the post helps you. This can be beneficial to other community members reading the thread.

    Monday, March 11, 2013 11:42 PM
    Moderator
  • Hi Michael, no offense taken, whatsoever. I mentioned the view because it works.. I'll have to revisit my query later on, probably some wrong join.

    I didn't know the data isn't refreshed. I'm glad I was made aware. 

    Your query works fine. Thanks again!

    Regards, Orlando


    Tuesday, March 12, 2013 8:58 AM