Skip to main content

Register-DMWmiFilter

SYNOPSIS

Registers the definition of a WMI Filter as desired state.

SYNTAX

__AllParameterSets

Register-DMWmiFilter [-Name] <string> [-Description] <string> [-Query] <string[]>
[[-Namespace] <string>] [[-Author] <string>] [[-CreatedOn] <datetime>] [[-ContextName] <string>]
[<CommonParameters>]

DESCRIPTION

Registers the definition of a WMI Filter as desired state.

EXAMPLES

EXAMPLE 1

Get-Content .\wmifilters.json | ConvertFrom-Json | Write-Output | Register-DMWmiFilter

Load up all settings defined in wmifilters.json

PARAMETERS

-Author

The author of the WMI filter. Purely documentational. Defaults to: undefined

Type: System.String
DefaultValue: undefined
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 4
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ContextName

The name of the context defining the setting. This allows determining the configuration set that provided this setting. Used by the ADMF, available to any other configuration management solution.

Type: System.String
DefaultValue: <Undefined>
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 6
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-CreatedOn

The timestamp the WMI filter was defined at. Purely documentational. Defaults to: Get-Date

Type: System.DateTime
DefaultValue: (Get-Date)
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 5
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Description

A description of the WMI filter

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Name

Name of the WMI Filter (must be unique in domain).

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Namespace

The WMI namespace in which the queries will be executed by default. Defaults to: root\CIMv2

Type: System.String
DefaultValue: root\CIMv2
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 3
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Query

The filter query/ies to apply. Can be multiple queries, defaults to the WMI namespace defined in the namespace parameter. To specify a namespace with the query, use this notation: {namespace};{query} (without the curly braces). Examples:

SELECT * FROM Win32_OperatingSystem WHERE Caption like "Microsoft Windows 10%"
root\CIMv2;SELECT * FROM Win32_OperatingSystem WHERE Caption like "Microsoft Windows 11%"
Type: System.String[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.