Allow & Forbid some models to be deployed with MDT


In this post I'll show you an easy way to allow or forbid some specific computer models to be deployed using MDT.

In my company our Windows 10 master can be installed only on some specific models from Lenovo or Microsoft. 
For instance supported models are Microsoft Surface 3 or Thinkpad T460 but a Thinkpad T430 can't be installed.
You can  find here a cool way to do this. In this post my colleague Nico, aka Diagg, use two new customsettings.ini variables (WhiteList & BlackList) to gather these models.
I'll show you another way to do this using an XML file and WMI Query. I'll focus on Lenovo and Microsoft vendors but you can easily and others.
We'll first see how to use the WMI query in the VBScript file, then how add your models in the XML file and finally how to implement the solution in your deployment.

How to get these scripts ?


Prerequisites
  • Copy My_Supported_Models.xml in Deploy\Scripts
  • Add supported models in My_Supported_Models
  • Copy Check_Supported_Models.vbs in Deploy\Scripts
  • Copy Check_Supported_Models.xml in Deploy\Scripts (2nd & 3rd methods)
  • The VBS works for Lenovo and Microsoft Surface
  • To include other vendor check the WMI query to add
  • SkipBDDWelcome must be set to NO

How it works ?

A VBScript will use a WMI query to check if the current model figures in the XML file. If Yes you'll be able to continue the deployment process, if not you won't and a message will inform you that your computer isn't supported. 

WMI query to use

The WMI class used is Win32_ComputerSystemProduct.
This query will return the result below on Lenovo models
WMI query on Lenovo models
This query will return the result below on Microsoft models
WMI query on Microsoft models
To check if a mdoel is supported I check the name attribute.
See below how to catch it using VBScript.

XML file to use

Populate the XML file with the models you want to install. 
See below the XML part using to allow ThinkPad T450/X250 - T460/X260, ThinkPad P50 and Workstations M900. As mentioned in the VBS part, for Lenovo models the main information is the MTM.

Allow only models from the XML
We'll use a VBScript to allow only models that figured in our XML files. 

We can imagine two ways to do this. In my case my favourite is the second.

As mentioned above, to display the wizards below, the SkipBDDWelcome parameter must be set to NO in both ini files customsettings and bootsrtap.

1 / Use the WelcomeWiz_Choice wizard to allow or not our models.
As mentioned previously, my colleague Nico aka Diagg used the BDDWelcome wizard to display that a model isn't supported and so block the deployment process. 
So why not using the same the same method ?

By default this wizard looks like as below:
Default BDD Welcome Wizard
We'll first modify a bit the WelcomeWiz_Choice.xml file to add a new button that will appear and replace the first button only in case the computer isn't supported.


See below the complete body part from the new WelcomeWiz_Choice.xml

Then we'll use the VBS below to display the above button for unsupported models and block the deployment process. 
You'll need to add this VBS in the WelcomeWiz_Choice.xml as below:
See below the Check_Supported_Models.vbs for this first method:

2 / Create a specific wizard to display an unsupported message
First you'll need to add the Check_Supported_Models.xml at the first place in the BDD_Welcome_ENU.xml
This way this wizard will be displayed before all the others, only if the model is unsupported.
See below the new wizard part from the BDD_Welcome_ENU.xml after adding our wizard.
See below the Check_Supported_Models.xml
See below the Check_Supported_Models.vbs: See below the result on an unsupported model, note that buttons Back, Next, Cancel and the header are disabled and hidden.
Methode 2: New wizard for unsupported models

To hide completly the FooterArea uncomment the Line 53 from the above VBS file. 
New wizard without footer

Share this

Related Posts

Previous
Next Post »