12 April 2012

Customizing the ZTIBiosCheck.wsf file for MDT/SCCM

Posted By: Mick Pletcher - 3:34 PM


& Comment

As there is not much documentation on how to use the ZTIBiosCheck.wsf file with MDT/SCCM, I had to figure a lot of it out. The WSF file retrieves the BIOS data via WMI queries to compare against the data stored in the ZTIBIOSCheck.xml file. The XML file comes with a blank template at the top and one prefilled example. It also has a script at the bottom that can be used to retrieve the information required by the XML file, but it is not clean. That is why I took that script and heavily modified it to output cleaner data and be SMS/SCCM deploy friendly by naming the output file to the computer model it was run on.

The first thing you will want to do is run the VBScript I rewrote, the link is at the bottom, on all of the model machines in your environment. That will return a text file on each system. Gather all of the text files and now you are ready to populate the ZTIBIOSCheck.xml file. Open up the XML file. You can delete the example in there, but leave the blank template. Copy the blank template and paste it directly underneath. Open up your first text file and you will see all of the necessary fields are there for you to fill in the data.

NOTE: In the output text files, you will notice that I put a less than (<) and greater than (>) symbols in front and  behind each of the data output fields. I did this because there will be spaces sometimes before and/or after the output data. Those spaces are important to include when populating the data in the XML file. So when you copy a field, be sure to copy from the less than to the greater than symbols, but not including them, otherwise the WSF file will not see the field as the same as what it read from the system.

Here is the VBScript I rewrote, along with a link to download it:

 REM ***************************************************************************  
 REM ***     Program: ZTIBIOS.vbs  
 REM ***      Author: Mick Pletcher  
 REM ***     Created: 12 April 2012  
 REM ***      Edited:   
 REM ***  
 REM *** Description: This script will retrieve the information required for   
 REM ***              populating the ZTIBIOSCheck.xml fields, located in   
 REM ***              c:\deploymentshare\scripts\ of the MDT server. It's  
 REM ***              output is stored in a file in the same directory as the  
 REM ***              script with the filename of the computer model.txt. This  
 REM ***              was done to accomodate using this script with SMS/SCCM on  
 REM ***              multiple models of machines to differentiate the outputs.  
 REM ***              This text file contains all of the necessary  
 REM ***              fields required for populating the information for a  
 REM ***              new system. There is a template field at the top of  
 REM ***              the xml file that you can copy and populate with the  
 REM ***              output data from this script. It is suggested that you  
 REM ***              update the BIOS to the latest version first before  
 REM ***              running this script, as that will update the information  
 REM ***              acquired by this script.   
 REM ***************************************************************************  
 Option Explicit  
 REM Define Objects  
 DIM FSO           : Set FSO           = CreateObject("Scripting.FileSystemObject")  
 DIM objFile       : Set objFile       = Nothing  
 DIM objHotfixFile : Set objHotfixFile = Nothing  
 REM Define Variables  
 DIM BIOS     : Set BIOS     = Nothing  
 DIM Computer : Set Computer = Nothing  
 For each Computer in GetObject("winmgmts:\\.\root\cimv2").InstancesOf("Win32_ComputerSystemProduct")  
      For each BIOS in GetObject("winmgmts:\\.\root\cimv2").InstancesOf("Win32_BIOS")  
           Set objFile = FSO.CreateTextFile(Trim(Computer.Name) & ".txt", True)  
           Set objHotfixFile = FSO.OpenTextFile(Trim(Computer.Name) & ".txt", 1,True)  
           objFile.WriteLine("Lookup Name:" & Chr(32) & Chr(60) & BIOS.Description & Chr(62))  
           objFile.WriteLine("Computer Manufacturer:" & Chr(32) & Chr(60) & Computer.Vendor & Chr(62))  
           objFile.WriteLine("Model:" & Chr(32) & Chr(60) & Computer.Name & Chr(62))  
           objFile.WriteLine("Date:" & Chr(32) & Chr(60) & BIOS.ReleaseDate & Chr(62))  
 REM Cleanup  
 Set FSO           = Nothing  
 Set objFile       = Nothing  
 Set objHotfixFile = Nothing  
 Set BIOS          = Nothing  
 Set Computer      = Nothing  

About Mick Pletcher

My blog is here to help solve issues I have encountered and solved, publish scripts I have written, and educate others in understanding areas that are not well covered


  1. This is great, thanks! Do you know of any way to work around a bios that isn't fully ACPI compliant? I have some Motorola MW800 machines that blue screen with a stop code of 5, which appears to be an ACPI compliance issue, when I boot it from the WinPE usb. We can't get rid of these machines for a while and have been using ghost until now. Is there maybe a way to load an older HAL perhaps?

  2. Sorry I missed your comment. I was out of the country for a few weeks at the time and forgot about it once I got back. What is the HDD configured as in the BIOS? I have seen that issue if it is not set to ATA and is instead set to AHCI. Give that a try.

  3. Thank you!

    Just to be sure: the wrong/incompatible BIOS versions end up in the .xml file right?

    Is it also possible to do a 'less than comparision'? FOr example, if BIOS-date is less then 201207120000 then give an error?


Copyright © 2013 Mick's IT Blogs™ is a registered trademark.