Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

HOWTO: Leverage Group Policies with WMI Filters


Author: Francis Ouellet MVP

View products that this article applies to.

Abstract

WMI filters are used to determine the scope of Group Policies based on computer attributes such as the operating system, free hard disk space or brand and model.  
 
WMI filters only apply on Windows XP and Winsows Server 2003 computers. WMI filters are ignored on earlier versions of Windows. In order to be able to filter policies you will need at least one domain controller running Windows Server 2003 in your environment.

↑ Back to the top


Step One : Install the Group Policy Management Console (GPMC) SP1

Download the GPMC SP1 from .
 
Install the GPMC SP1 according to the setup instructions.

↑ Back to the top


Step Two: Create a WMI filter

Once installed open the GPMC under Administrative Tools
Expand the domain under which you want to create a WMI Filter
Right-Click the WMI Filter object and select New…
Type in a Name and a friendly description for your new filter
The current namespace should be root\CIMv2; This is the most common namespace for WMI queries. All Win32_* classes are located.

↑ Back to the top


Step Three: Create your WMI query using WQL

In the Query textbox write your query.
Here is a query that would return true if the C: drive has at least 100MB free
 
Select * from Win32_LogicalDisk where FreeSpace > 104857600 AND Caption = "C:"
 
How to determine all of the Win32_* available classes and properties?
 
Download the WMI Tools available at
 
Using the WMI Object browser you can search for classes and even see all the different properties.

↑ Back to the top


Step Four: Assign a WMI Filter to a Group Policy

Step Four: Assign a WMI Filter to a Group Policy
 
Select the Group Policy Object and in the right pane, in the WMI Filtering section click the drop down menu and select the WMI Filter you have just created.
The Group Policy will only be applied if the WMI Filter assigned returns true.

↑ Back to the top


Related websites

Group Policy Processing Stops After You Apply a WMI Filter to a GPO

 
WMI Filters overview

 
Managing WMI security

 
Windows Management Instrumentation (WMI)

 
WMI Classes

↑ Back to the top


About the author.

The author is a Windows system administrator located in Montreal, Quebec; He can be reached at francis@francisouellet.ca

↑ Back to the top


Community solutions content disclaimer

Microsoft corporation and/or its respective suppliers make no representations about the suitability, reliability, or accuracy of the information and related graphics contained herein. All such information and related graphics are provided "as is" without warranty of any kind. Microsoft and/or its respective suppliers hereby disclaim all warranties and conditions with regard to this information and related graphics, including all implied warranties and conditions of merchantability, fitness for a particular purpose, workmanlike effort, title and non-infringement. You specifically agree that in no event shall Microsoft and/or its suppliers be liable for any direct, indirect, punitive, incidental, special, consequential damages or any damages whatsoever including, without limitation, damages for loss of use, data or profits, arising out of or in any way connected with the use of or inability to use the information and related graphics contained herein, whether based on contract, tort, negligence, strict liability or otherwise, even if Microsoft or any of its suppliers has been advised of the possibility of damages.

↑ Back to the top


Keywords: kb, kbpubtypecca, kbpubtypewp, kbpubmvp, kbhowto, KB555253

↑ Back to the top

Article Info
Article ID : 555253
Revision : 1
Created on : 2/14/2017
Published on : 2/14/2017
Exists online : False
Views : 432