What if Group Policy could read your mind? WMI Filters can make that possible. They can query your computers and apply GPOs if certain conditions exist. You can install software when a user connects a device, filter GPOs to laptops, or prevent problems when you image computers!
In this post, we are going to create three WMI filters that can make your Group Policy life so much easier! In just 700 words, you will be able to make WMI magic. If you haven’t, read our primer on WMI and how it works before creating a WMI filter.
WMI Filter #1: Installing an Application if Hardware is Connected
Three conditions have to be met before a GPO can be processed. The GPO has to be linked to the object, the object has to be in the security filtering scope, and the WMI filter has to evaluate as true. With most GPOs, you will only edit links and the security scope. The screenshot below shows a GPO configured with a WMI filter.
Our first filter will allow an application to install if a particular piece of hardware is connected to the machine. Our GPO has a computer side application in it and it currently scoped to a security group. To create a WMI filter, right click on the WMI Filters node in the GPMC and select New. Name your filter Hardware: SmartBoard and then select Add. We now need a way to filter machines with a Smartboard connected. We can use the class PNPEntity and look for a specific device.