UEFI check in task sequence


 

In this post I will show you have to create 3 steps in your task sequence that checks if the computer is running UEFI. This is useful if you are installing Windows 10 and want to make sure the UEFI is enabled. The check is running at the start of the task sequence, so it doesn’t format the disk if the BIOS setting is not UEFI. This means that you can boot the Pc with the old installation if the check fails. If you want to semi automate the switch from BIOS to UEFI, see this post. 1E have a fully automated process and you can get more information here. Nickolai Andersen have a blog post where he automate the switch on Dell computers. Thanks to the blog post on Garytown for the inspiration.

 

1. Download UEFI_Check.zip and create a package, without a program, in SCCM called “UEFI Check”

2. Create a New Group at the beginning of the task sequence and call it “UEFI Check for Windows 10”

image

3. Add the following conditions to the group:

a. If All conditions are true
aa. Task Sequence variable: OSDImage equals “WIN10” (If you don’t have more then on image in your TS, then you don’t need this step.)
ab. Task Sequence variable: _SMSTSBootUEFI not equals “True” (This is used to check for UEFI)
ac. Task Sequence variable: _SMSTSinWinPE equals “True” (This is to make sure that this step is only running in WinPE)
ad. If ANY conditions are true
aaa. WMI Query: SELECT * FROM Win32_ComputerSystem WHERE Model LIKE “%HP%” (This is to make sure that it runs on a HP computer.)
aab. WMI Query: Select * from Win32_ComputerSystem WHERE Manufacturer like “%Hewlett-Packard%” (This is to make sure that it runs on a HP computer.)
aac. WMI Query: SELECT * FROM Win32_ComputerSystem WHERE Manufacturer LIKE “%Dell%” (This is to make sure that it runs on a DELL computer.)

image

4. Create a “Run command line” step in the group you created in step 2 and call it “UEFI Check”.

image

4. Choose the package that you made in step 1 and add the message that you want to display. The syntax is:
cscript.exe MDTMessageBox.wsf /text:”WARNING – This Machine is not set to UEFI in the BIOS – Please Shutdown, fix the Setting and Start again” /type:64 /title:”UEFI”

image

5. Add a “Run Command line” step after your UEFI Check for Windows 10 in the group you created in step 2 and call it “Shutdown WinPE UEFI Fails”. This step will shutdown the Pc if the Pc doesn’t have UEFI set.

image

6. Command line: Shutdown.exe, Package: UEFI Check

image

7. You task sequence should look like this now:

image

 

With the above step in the task sequence, it will fail if you try to install Windows 10 on a Pc where UEFI is not set in the BIOS.