Project

GPOZaurr

GPOZaurr helps inspect, report on, and remediate Group Policy environments with PowerShell.

Stars 1,250
Forks 119
Open issues 15
PowerShell Gallery downloads 421,558
Release v1.1.11
Language: PowerShell Updated: 2026-10-09
Command

New-GPOZaurrWMI

Module GPOZaurr

Creates a new WMI filter based on a WMI filter query.

Syntax

New-GPOZaurrWMI [[-Description] <String>] [[-ExcludeDomains] <String[]>] [[-ExtendedForestInformation] <IDictionary>] [-Force] [[-Forest] <String>] [[-IncludeDomains] <String[]>] [-Name] <String> [[-Namespace] <String>] [-Query] <String> [-SkipQueryCheck] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

This function creates a new WMI filter in Active Directory based on a specified WMI filter query.

Examples

Authored help example

EXAMPLE 1

New-GPOZaurrWMI -Name "TestWMIFilter1" -Query "SELECT * FROM Win32_OperatingSystem" -Force
Creates a new WMI filter named "TestWMIFilter1" targeting all Windows operating systems.

EXAMPLE 2

New-GPOZaurrWMI -Name "TestWMIFilter2" -Query "SELECT * FROM Win32_Processor" -Forest "Contoso" -IncludeDomains "FinanceDomain"
Creates a new WMI filter named "TestWMIFilter2" targeting all processors in the "FinanceDomain" within the "Contoso" forest.

Parameters

-Description String optionalposition: 1
The description for the new WMI filter. Default is an empty string.
-ExcludeDomains String[] optionalposition: 5
An array of domains to exclude from WMI application.
-ExtendedForestInformation IDictionary optionalposition: 7
Additional information about the forest for WMI customization.
-Force SwitchParameter optional
Switch to force the creation of the WMI entry without confirmation.
-Forest String optionalposition: 4aliases: ForestName
The forest to target for WMI creation.
-IncludeDomains String[] optionalposition: 6aliases: Domain, Domains
An array of domains to include for WMI application.
-Name String requiredposition: 0
The name of the new WMI filter to be created.
-Namespace String optionalposition: 2
The WMI namespace to target. Default is 'root\CIMv2'.
-Query String requiredposition: 3
The WMI filter query to be applied to the WMI entry.
-SkipQueryCheck SwitchParameter optional
Switch to skip the query check before creating the WMI entry.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.