Endpoint Management User Group (Osterreich, Schweiz, Deutschland)

 View Only
Expand all | Collapse all

WMI class interrogation fails when COM objects are also interrogated

  • 1.  WMI class interrogation fails when COM objects are also interrogated

    Posted Sep 23, 2015 08:50 AM
      |   view attached

    Hello all,

    A customer has created a custominv VBS file (patchinv.txt) for their NS 6.0 SP3 R13 environment, that gathers data from the following locations: 

    Set objWinInstaller = CreateObject("WindowsInstaller.Installer")
    Set colQFE = GetObject("winmgmts:{impersonationLevel=impersonate}!root\cimv2").ExecQuery ("SELECT * FROM Win32_QuickFixEngineering")

     

    They have found that this works on the majority of their Windows 7 x64 machines; however, on some of them only the COM object data is gathered.

     

    To investigate this issue, we ran two seperate VBS files that scanned each location individually (patchinv_quickfixengineering.txt & patchinv_windowsinstaller.txt) and found that both scans gathered the required data from the problem machines. 

    We then merged both of those scans into one VBS (patchinv_full.txt) and found that it too only brought back the COM object data. 

     

    Does anyone have any idea as to what could be cause this, so that the customer can obtain 100% patch information? 

     

    SK

    Attachment(s)

    7z
    CustInvFiles.7z   1 KB 1 version


  • 2.  RE: WMI class interrogation fails when COM objects are also interrogated

    Broadcom Employee
    Posted Sep 23, 2015 10:29 AM

    Hi SK,

    Is it possible to attach "good" resulting file and "bad" resulting file, with "only the COM object data is gathered"?

    (wild guesses)

    Could it be that script patchinv_full.txt executed under different user than separate scripts? 

    UAC settings might affect VB script execution.

    System state (logged off, with active screen screen) also might affect scripts.

    Thank you,

    Alex.

     



  • 3.  RE: WMI class interrogation fails when COM objects are also interrogated

    Posted Sep 23, 2015 10:54 AM
      |   view attached

    Hello Alex,

    Attached you will find a good bak file, a bad nsi, as well as the outputs from the standard vbs files. 

    After reviewing the bak file, it seems that the scan did not complete as the closing xml code is missing; however, the PatchFullInv.txt file contains the same data and it displayed a Done message box. 

    All standard VBS files were run under the same user context.  The actual custom inventory VBS was run as SYSTEM as part of an inventory scan. 

    The user was logged in when the standard VBS as well as the inventory scan was run.

    SK

    Attachment(s)

    7z
    Outputs.7z   7 KB 1 version


  • 4.  RE: WMI class interrogation fails when COM objects are also interrogated

    Broadcom Employee
    Posted Sep 23, 2015 11:13 AM

    Hi Scott,

    • NT Event logs don't have any useful information why this happens on client PC?
    • "Procmon.exe" shows any useful information, while this problem occurs on client PC?

    Thanks,

    IP.



  • 5.  RE: WMI class interrogation fails when COM objects are also interrogated

    Posted Sep 23, 2015 11:54 AM
      |   view attached

    Hi SK, I just ran your three scripts on my Win 7 x64 and they all seemed to work Ok.  I have attached the three script outputs.  There is a difference in the formatting of the QFE data but it all seems to be there.  What are you missing?

     

    Regards,
    Darren.

    Attachment(s)

    7z
    sym_vbs_results.7z   5 KB 1 version


  • 6.  RE: WMI class interrogation fails when COM objects are also interrogated

    Posted Sep 24, 2015 01:51 AM

    Hello Darren,

    Yes, normally these scripts work for the customer too; however, they have identified a large number of machines where only the COM object information is gathered by the scan that also interrogates the WMI class. 

    SK.



  • 7.  RE: WMI class interrogation fails when COM objects are also interrogated

    Broadcom Employee
    Posted Sep 24, 2015 05:06 AM
      |   view attached

    Hi SK,

    Weird issue, cannot reproduce on my Win7-s.. So far I have only one suggestion:

    In patchinv_full.txt you have three lines with declatations of variables that are used in two "for" cycles further.

    Divide thes section onto two parts: one will declare everything for the frst cycle (i.e. "For Each objProduct In objWinInstaller.Products") and second will declare all for the second cycle ("For Each objQFEPatch In colQFE"). Move all declarations related to the second cycle after the first cycle and avoid using variables with the same names (part0, part1, part2, part3) in different cycles (example attached).

    Thank you,

    Alex.

    Attachment(s)



  • 8.  RE: WMI class interrogation fails when COM objects are also interrogated

    Posted Sep 24, 2015 08:50 AM

    It may be a terminology issue(!) but I'm not sure what you mean by 'only the COM object information is gathered'.  Do you have a sample log that shows only some info collected?  Or do you mean that the Windows Installer COM object is returning data but the QFE WMI class isn't?



  • 9.  RE: WMI class interrogation fails when COM objects are also interrogated

    Posted Sep 24, 2015 08:57 AM

    Hello Darren,

    Yes, I mean when the scan runs that targets both the COM & WMI locations, it only returns data for the WindiowsInstaller.Installer COM object. 

    SK



  • 10.  RE: WMI class interrogation fails when COM objects are also interrogated

    Posted Sep 24, 2015 09:05 AM

    Hello Alex,

    I will let you know once the customer has run it. 

    SK



  • 11.  RE: WMI class interrogation fails when COM objects are also interrogated

    Posted Sep 24, 2015 09:06 AM

    Hello Igor,

    If Alex's modified VBS does not work, we will take a look in those areas. 

    SK



  • 12.  RE: WMI class interrogation fails when COM objects are also interrogated

    Posted Sep 24, 2015 09:22 AM

    OK I've now seen your Outputs.7z that you posted above too where the .nsi is truncated.

    So I've executed the same script on my machine - the WindowsInstaller.Installer bit runs instantly but the WMI QFE bit takes many seconds to complete.

    Is it possible that the script is just taking ages to complete and when the nsi is uploaded it is not complete yet?  If I take the nsi too quickly then the QFE has not finished yet and then my nsi looks similar to your bad one.

    How about trying this:  Change the script to write the nsi to %temp%, but then at the end *copy* the nsi to the Inventory folder.

    What do you think?



  • 13.  RE: WMI class interrogation fails when COM objects are also interrogated

    Posted Sep 24, 2015 09:40 AM

    Hello Darren,

    When the standard VBS file is run, it displays a Done message box when completed, and that too fails to bring in the QFE data; however, I will keep that in mind if Alex's VBS doesn't help.

    SK