Inventory Windows Computers Boot Mode - UEFI or Legacy BIOS
search cancel

Inventory Windows Computers Boot Mode - UEFI or Legacy BIOS

book

Article ID: 179300

calendar_today

Updated On:

Products

Inventory Solution

Issue/Introduction

 Inventory Windows Computers Boot Mode - UEFI or Legacy BIOS

Environment

ITMS 8.x

Resolution

Custom inventory can be used to detect result from Windows Boot Loader to determine if it is using Legacy boot mode or UEFI.  This article also presents a custom report that displays this custom inventory data. Please note that Symantec Support does not support custom scripting or reporting so modifications to the script and report must be made by the user.

  1. Create a new custom Data Class that will store the Bios Mode for each endpoint.

Figure 1. Configuration for the Custom Data Class and its Attributes.

  1. Go to Settings > All Settings then Settings > Discovery and Inventory > Inventory Solution > Manage Custom Data Classes.
  2. Click New data class.
  3. Name the Data Class "BIOS_Mode" and click OK.
  4. Click Add attribute.
  5. Name the Attribute "mode", set Key to "No", and click OK.
  6. Add one more attribute the same way, naming it time.
  7. Enable Allow multiple rows from a single computer resource, then click Save changes. The final dataclass should look like figure 1.
  8. Then click the icon to open the Data Class Details and copy the GUID a notepad. See figure 1.1 below.

Figure 1.1 Retrieve GUID of the Customer Data Class

  1. Create a Custom Inventory Script Task.
    1. Go to Manage > Jobs and Tasks.
    2. Browse the folder drop-down menu to where you would like to add a custom inventory script task.
    3. Right Click on the folder, then select New > Task.
    4. Select the Run Script task.
    5. Name the task appropriately.
    6. Select Script type: PowerShell.
    7. Copy and paste the entire Script below into the large text box of the script task.

#************************DO NOT EDIT********************************

$nse = new-object -comobject Altiris.AeXNSEvent

$nse.priority = 1

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

#************************DO NOT EDIT********************************

 

#Modify this varaible with the custom data class guide

$objDCInstance = $nse.AddDataClass("{COPY the GUID in Step 1.h here}")

 

# Gather Boot Mode Information

$objDataClass = $nse.AddDataBlock($objDCInstance)

$mode = bcdedit | findstr '\Windows\system32'

#path                    \Windows\system32\winload.exe

$mode = $mode.replace("path                    \Windows\system32\","")

$time = Get-Date -Format g

 

#Add new row of data

$objDataRow = $objDataClass.AddRow()

$objDataRow.SetField(0, $mode)

$objDataRow.SetField(1, $time)

 

#************************DO NOT EDIT********************************

#Send the data

$nse.sendqueued()

#************************DO NOT EDIT********************************

  1. Run the Custom Inventory Script task.
    1. Click on New Schedule, choose Now or specify a schedule time and repeat interval.
    2. Specify target computers to run the task on.
    3. To target a single computer, click in the Quick add: box and search for the name of the computer, or use the Quick Run feature instead of New Schedule
    4. To target a list of computers, click on Add > Computers or Devices then manually select the desired computers and click > and OK
    5. To target a computer filter (such as All Computers) click on Add > Target, click Add rule, choose exclude computers not in, and search the name of the filter in the final drop-down box. then click OK.
  2. Create a Custom Report to view the data collected by the Custom Inventory
    1. Go to Reports > All Reports.
    2. Browse to a folder where you would like to add the custom report and Right Click on the folder.
    3. Select New > Report > SQL Report.
    4. Give the Report an appropriate name and then replace the text under Parameterized Query with the following query:

SELECT        vc.Name,

bm.time,

CASE WHEN mode = 'winload.exe' THEN 'LEGACY' ELSE 'UEFI' END [MODE]

FROM Inv_BIOS_Mode bm

join vcomputer vc ON vc.Guid = bm._ResourceGuid

ORDER BY MODE

  1.  Click Save Changes and then view the collected data for each computer and its drives. The results should look like figure 3.

Figure 3. Note that Time is the Agent Time when inventory data was collected