Deploying Windows has fed my kids and put a roof over my head for a few years so its safe to say that I take it seriously. Sometimes I like to automate things and try to find the simplest way of doing stuff where possible. I don’t cut corners however. Never. But recently I’ve found a few who do. A few engineers I worked with (for a client) were specifically instructed to only build HP machines. I stress again ONLY HP.
The reasons were political, but they chose to ignore this as they had all the drivers for their laptops, they continued to use the single task sequence and build just about anything they had drivers for. Needless to say, the managers were pissed off and they wanted to simply remove the task sequence and instructed me to create another, ready for production in 2 hours …
Simple you say? Problem was, they had a whole bunch of scripts and PowerShell commands going off in every direction with all the applications (bespoke apps … ) all ready in place and everything worked. “Remove the drivers” one guy shouted, but driver installation happens after the OS has been applied, so you’d end up with “bricked” machines. And out of no where … the IT director gets involved and wants me to “do something fast”… Nice.
So, all I did was to add in a check to ensure that only supported hardware was allowed to execute the tasks sequence. These are the steps you’ll need to add the step into your task sequence.
So I used MDT integrated tasks sequences for a start, so make sure you add this before you get into the meat of the task sequence like disk formatting … you need to click …
Edit, Task Sequence …
Add -> New Task Sequence Variable ->
Name = Supported Hardware Check ->
Description = HP laptops only can be built using this task sequence ->
Task Sequence Variable = IsSupportedHardwareModel ->
Value = TRUE
Next you need to add the following conditions on the Options Tab
If All conditions are true:
(WMI Query) Select * from Win 32 ComputerSystem WHERE Manufacturer LIKE “%Hewlett-Packard”%
(You can further expand if you like and add in another WMI query to only allow a certain model, where XXXXX is the number of your specific model)
(WMI Query) Select * from Win 32 ComputerSystem WHERE Model LIKE “%XXXXX”%
It should look like something like this
If the conditions are not met the task sequence stops early and you can go on with building only supported hardware!
Please DO NOT check the “Continue on error” box … 🙂 and remember if you copied and pasted the WMI query from the blog post, replace the speech marks ” ”