Client Management Suite

 View Only

Custom data class and scan report for IME Critical Firmware Update (Intel SA-00086)

  • 1.  Custom data class and scan report for IME Critical Firmware Update (Intel SA-00086)

    Posted Dec 01, 2017 04:10 AM

    Hi All,

    I'm not professional in VBS but i just wrote this for Intel SA-00086 Detection Tool

    and sharing idea and solution for the error below,

    1) By setting the working directory for WScript.Shell Run helps to slove the "Error: The file 'CommandLine.dll' authentication has failed."

    2) Store the xml file to TEMP folder instead of the directory that the tool is running from

    objDataRow.SetField 0 i was reserved for [computer name], else you should start with 0

    Do advice me if the code can be improve or you have a better idea

     

    'Start here

    '===================================================================================================================

    const HKEY_LOCAL_MACHINE = &H80000002

    strComputer = "."

     

    dim fso, ws

    Set fso = CreateObject("Scripting.FileSystemObject")

    Set ws = WScript.CreateObject("WScript.Shell")

     

    dim tfolder

    Const TemporaryFolder = 2

    Set tfolder = fso.GetSpecialFolder(TemporaryFolder)

     

    strApp = "\\YOURSERVER\Altiris\IntelSA00086\DiscoveryTool\INTEL-SA-00086-console.exe"

    arrPath = Split(strApp, "\")

    For i = 0 to Ubound(arrPath) - 1

        strAppPath = strAppPath & arrPath(i) & "\"

    Next 

    ws.CurrentDirectory = strAppPath

    ws.Run (strApp & " -c -p " & tfolder),true,1

     

    'To show the script output on Altiris task

    Wscript.Echo ws.CurrentDirectory

    Wscript.Echo (strApp & " -c -p " & tfolder)

    '===================================================================================================================

     

    'Create instance of Altiris NSE component and set the header data of the NSE

    dim nse

    set nse = WScript.CreateObject ("Altiris.AeXNSEvent")

     

    ' Set the header data of the NSE

    ' Please don't modify this GUID

    nse.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}"

    nse.Priority = 1

     

    'Create Inventory data block

    dim objDCInstance

    set objDCInstance = nse.AddDataClass ("IntelSA00086") ' Your dataclass here

     

    dim objDataClass

    set objDataClass = nse.AddDataBlock (objDCInstance)

     

    strCM = ws.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Intel\Setup and Configuration Software\INTEL-SA-00086 Discovery Tool\Hardware Inventory\Computer Model")

    strP = ws.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Intel\Setup and Configuration Software\INTEL-SA-00086 Discovery Tool\Hardware Inventory\Processor")

    strMEV = ws.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Intel\Setup and Configuration Software\INTEL-SA-00086 Discovery Tool\ME Firmware Information\ME Version")

    strST = ws.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Intel\Setup and Configuration Software\INTEL-SA-00086 Discovery Tool\System Status\System Risk")

    strScanDate = ws.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Intel\Setup and Configuration Software\INTEL-SA-00086 Discovery Tool\Scan Date")

     

    'Add a new row and set column values

    dim objDataRow

    set objDataRow = objDataClass.AddRow   

    'Set columns

    objDataRow.SetField 1, strCM

    objDataRow.SetField 2, strP

    objDataRow.SetField 3, strMEV

    objDataRow.SetField 4, strST

    objDataRow.SetField 5, strScanDate

     

    nse.SendQueued

    Set fso = Nothing

    Set ws = Nothing

    '===================================================================================================================

    'End here

     

    Data class:

     

    and finally the result will look like this

    Query as below,

    DECLARE @v1_TrusteeScope nvarchar(272)

       SET @v1_TrusteeScope = N'{055DBB03-7B1A-4E0D-9C19-D37160C9A9D6},{2E1F478A-4986-4223-9D1E-B5920A63AB41},{582029E2-FC5B-4717-8808-B80D6EF0FD67},{8105F0BC-206C-4567-9231-A2A06648AECC},{964E50A5-0312-4F51-9A51-1B9A529FE17C},{B760E9A9-E4DB-404C-A93F-AEA51754AA4F},{BDA3284C-21CC-4BC4-8D22-97B68A05A70D}'

    SELECT

       [vri2_Computer].[Guid] AS [_ItemGuid],

       [vri2_Computer].[Name],

       [dca3_IntelSA00086].[ME Version],

       [dca3_IntelSA00086].[Processor],

       [dca3_IntelSA00086].[System Risk],

       [dca3_IntelSA00086].[Scan Date],

       [dca4_SW BIOS Element].[Version] AS [BIOS Version],

       [dca4_SW BIOS Element].[Release Date] AS [BIOS Release Date]

    FROM

       [vRM_Computer_Item] AS [vri2_Computer]

          LEFT OUTER JOIN [Inv_IntelSA00086] AS [dca3_IntelSA00086]

             ON ([vri2_Computer].[Guid] = [dca3_IntelSA00086].[_ResourceGuid])

          LEFT OUTER JOIN [Inv_SW_BIOS_Element] AS [dca4_SW BIOS Element]

             ON ([vri2_Computer].[Guid] = [dca4_SW BIOS Element].[_ResourceGuid])

    WHERE

       (

          (

             ([vri2_Computer].[IsManaged] = 1)

          )

          AND

          ([vri2_Computer].[Guid] IN (SELECT [ResourceGuid] FROM [ScopeMembership] WHERE [ScopeCollectionGuid] IN (SELECT [ScopeCollectionGuid] FROM dbo.fnGetTrusteeScopeCollections(@v1_TrusteeScope))))

       )

    ORDER BY

       [vri2_Computer].[Name] ASC