Install drivers by computer model using WMI query

When using task sequence, you might want to install different driver packages for different computer models. This can be accomplished by using a WMI query.

First of all you need to have driver packages for all your computer models and know the exact model name for every computer.

To find this, open a command prompt and type WMIC ComputerSystem GET Model (use this command on every computer to find its model).

Then, Edit your task sequence. Add how many steps you need with “Apply Driver Package”. Select the driver package you have created for a certain computer model (HP dc5700 in my case).

Apply Driver Package

In the Options tab, click Add Condition and select Query WMI. In the WMI Query Properties window, make you sure you have root\cimv2 as WMI Namespace and write the following query in the WMI Query input box:

SELECT * FROM Win32_ComputerSystem WHERE Model LIKE “%dc5700%” for HP Compaq dc5700 computer models.

WMI Query

Now, for every driver package, replace the model name with the computer model name the driver package is for. This way, the task sequence will install the correct drivers on every computer that will match the model specified in the query and will skip other steps sending the following status message: “The task sequence execution engine skipped the action (HP Compaq dc5700) in the group (Apply driver packages) because the condition was evaluated to be false”.

Deploy ePolicy Orchestrator (ePO) agent

Having to create a package with McAfee ePO agent, I wanted to make it available to task sequence too so it can be installed during the operating system setup. For this, I had to make it install unattended or silent not requiring any user input. As I have never worked with McAfee, first, I did not understand what the purpose of this agent is. I couldn’t understand why you should install the agent and not the antivirus software itself? When I did, I started to think how to deploy it easily and with no user interaction.

So, to do this, simply put FramePkg.exe into a folder, say “ePO”, and create a package as you normally would. Then create a program that has the following command line FramePkg.exe /install = agent /silent.

If you want to install ePO as part of one task sequence, make sure the program can run whether or not a user is logged on and do not allow users to interact with the program.

This way, after the computer is added to domain, it will connect to the server and will receive all necessary settings (for example install antivirus software, patches and latest definition updates).