OSD Pre-Flight check


2016-07-04 UPDATE: I have updated the hta script, because there was an issue with the Wi-Fi and UEFI detection. It is fixed now.

——————————————————————-

Last week I created this post on how you can do a UEFI check if you are installing Windows 10. I have extended that check with this Pre-Flight Check.

To make sure that a Pc is ready for your task sequence deployment and to minimize the risk of an error during OSD, you can do some checks before you start your OS deployment with a Pre-Flight check. This Pre-Flight check have to be at the beginning of your task sequence, because then you don’t break break anything on the existing installation if the requirement is not meet. This solution is using this hta with some customization that I have made.

Here is the things that I would like to check for:

– Only supported hardware models (To make sure that there is driver for the model)
 – Network connection (To make sure that we can access the SCCM environment)
– No USB drives attached (To make sure that there is no USB drives attached)
– For laptops, AC power connected (So it is not running on battery)
– UEFI Check (To force UEFI if task sequence is Windows 10)
– Drive Encryption Check (To make sure that the HDD is not encrypted)
– WiFi check (To make sure that a laptop is not running the OSD on Wi-Fi)

If all the checks are Success, then the HTA will automatic countdown from 15 seconds and continue. Otherwise the user have to correct the problems and click on the ‘Refresh’ bottom to continue. The user cannot continue if ALL the check are not a success.

You have to have HTA-Support enabled in the boot image. To enable that do the following:

1. Open your SCCM console and go to: Software Library –> Operation Systems –> Boot Images
image

2. Right click on your boot image and choose “Properties”
image

3. Select the “Optional Components” tab.
image

4. Click “New”
image

5. Select “HTML (WinPE-HTA)” and click “OK”
image

6. Click “OK”
image

7. Click “Yes” to update the distribution points
image

8. Click “Next”
image

9. SCCM is now doing it’s thing…..
image

10. Click “Close”
image

SCCM have updated your distribution points and your boot image have HTA support.

Now we are going to implement the HTA.

1. Download OSD Pre-Flight Checks.zip and extract the files to a folder called “OSD Pre-Flight Check”

2. There is 4 files that you can edit:
a. “background.png” You can add your own background
b. “logo.png” You can add your company loge
c. “ComputerModels_w7.txt” and “ComputerModels_w10.txt” These files are used for your supported computer models. The values here should be the same as the value in WMI in the Win32_ComputerSystemProduct Class in either Name or Version Property depending on you Manufacturer.
image

3. Edit the “PreFlight.hta” line 154 and add the IP address of the servers that you would like to ping. Ex. your SCCM servers
image

4. I’m using a computer variable called “ODSImage” where I write witch OS the task sequence should apply. In this example “WIN7alm” for Windows 7 and “WIN10alm” for Windows 10. If you have more images you should add them with an “OR” to line 144:
image

and line 193:
image

and line 237:
image

5. You can either create a share for the files or create a SCCM package. In this example I will use a share.
Copy the folder “OSD Pre-Flight Check” to a server and share it with read permissions.

6. Create a New Group at the beginning of your task sequence and called it “OSD Pre-Flight Check”
image

7. Add a “Connect to Network Folder” step and call it “Connect to OSD Pre-Flight Check Folder”. Path=\\SERVER\SHARE, Drive: z:, Account: “A account that have access to the share
image

8. Add a “Run Command Line” step and call it “Run OSD Pre-Flight Check”. Command line: Z:\PreFlight.hta, Start in: Z:\
image

9. Add these variables to the “Execute Task Sequence” group:
a. IsOnACPower equals TRUE
b. IsSupportedHardwareModel equals TRUE
c. IsUSBDriveAttached equals FALSE
d. IsOnNetwork equals TRUE
e. IsOnWiFi equals FALSE
f. IsUEFI equals TRUE
g. IsDiskEncrypted equals FALSE
image

That’s it. You now have a Pre-Check in your task sequence. Here is a couple of screenshots how it looks:

image

image

image