< Back

Set-GPWmiFilter

Tue Jan 14, 2020 12:17 am

NAME Set-GPWmiFilter



SYNOPSIS

Update the settings of a WMI filter.





SYNTAX

Set-GPWmiFilter [-Name] <String[]> [-Filter <String[]>] [-Description <String>] [-PassThru] [-Server <String>]

[-Credential <PSCredential>] [-EnableException] [-WhatIf] [-Confirm] [<CommonParameters>]



Set-GPWmiFilter -Guid <Guid[]> [-Filter <String[]>] [-Description <String>] [-PassThru] [-Server <String>]

[-Credential <PSCredential>] [-EnableException] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Update the settings of a WMI filter.





PARAMETERS

-Name <String[]>

The name of WMI filter you want to query out.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-Guid <Guid[]>

The guid of WMI filter you want to query out.



Required? true

Position? named

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Filter <String[]>

The expression(s) of WQL query in new WMI filter. Pass an array to this parameter if multiple WQL queries

applied.



Required? false

Position? named

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Description <String>

The description text of the WMI filter.



Required? false

Position? named

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-PassThru [<SwitchParameter>]

Output the updated WMI filter instance with this switch.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Server <String>

The server to contact.

Specify the DNS Name of a Domain Controller.



Required? false

Position? named

Default value $env:USERDNSDOMAIN

Accept pipeline input? false

Accept wildcard characters? false



-Credential <PSCredential>

The credentials to use to contact the targeted server.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-EnableException [<SwitchParameter>]

This parameters disables user-friendly warnings and enables the throwing of exceptions.

This is less user friendly, but allows catching exceptions in calling scripts.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

If this switch is enabled, no actions are performed but informational messages will be displayed that explain

what would happen if the command were to run.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

If this switch is enabled, you will be prompted for confirmation before executing any operations that change

state.



Required? false

Position? named

Default value

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



OUTPUTS



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



PS C:\\>Set-GPWmiFilter -Name 'Workstations' -Filter 'SELECT * FROM Win32_OperatingSystem WHERE ProductType = "1"'



Set WMI filter named with "Workstations" to specific WQL query









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



PS C:\\>Get-GPWmiFilter -Server contoso.com | Set-GPWmiFilter -Server fabrikam.com



Updates changes made to the wmi filters in the domain contoso.com to the wmi filters in the domain fabrikam.com.











RELATED LINKS