< Back

New-StandardGPOWmiFilters

Fri Jan 10, 2020 7:08 pm

NAME New-StandardGPOWmiFilters



SYNOPSIS

Creates a standard set of WMI filters.





SYNTAX

New-StandardGPOWmiFilters [[-Domain] <String>] [-WithReplace] [-Credential <PSCredential>] [-PassThru]

[<CommonParameters>]



New-StandardGPOWmiFilters -AddToForest [-WithReplace] [-Credential <PSCredential>] [-PassThru] [<CommonParameters>]





DESCRIPTION

The cmdlet creates a set of WMI filters for each domain in the forest, or a particular domain. Some of the

software filters use custom WMI classes Win32_Software and Win32_Software64 that can be installed through the

Set-Win32Software script on PowerShellGallery.





PARAMETERS

-AddToForest [<SwitchParameter>]

Adds the WMI filters to each domain in the forest of the current user.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Domain <String>

The domain to create the WMI filters in. This defaults to the domain of the current user.



Required? false

Position? 1

Default value [System.String]::Empty

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-WithReplace [<SwitchParameter>]

If a WMI filters exists with the same name as ones in the standard set, the WMI query expression is updated.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Credential <PSCredential>

Specifies a user account that has permission to perform this action. The default is the current user.



Type a user name, such as "User01" or "Domain01\\User01", or enter a PSCredential object, such as one generated

by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password.



If the AddToForest parameter is specified, the credentials must have Enterprise Admin rights, otherwise they

need Domain Admin rights for the specified domain.



Required? false

Position? named

Default value [System.Management.Automation.PSCredential]::Empty

Accept pipeline input? false

Accept wildcard characters? false



-PassThru [<SwitchParameter>]



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String





OUTPUTS

System.Collections.Hashtable[]





NOTES





AUTHOR: Michael Haken

LAST UPDATE: 1/7/2017



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>New-StandardGPOWmiFilters -AddToForest



Creates standard WMI Filters in every domain in the current forest. The user must be an enterprise admin for this

command to succeed.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>New-StandardGPOWmiFilters -Domain contoso.com -WithReplace



Creates standard WMI Filters in the contoso.com domain and replaces the query value for any existing filters that

have a matching name as a new one being created through the cmdlet.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>New-StandardGPOWmiFilters



Creates standard WMI Filters in the current domain of the user. The user must be a domain admin for this command

to succeed.











RELATED LINKS