Set-CMStatusMessageQuery

Changes settings or security scope or deletes messages for a Configuration Manager status message query.

Syntax

Set-CMStatusMessageQuery
   [-Comment <String>]
   [-Confirm]
   [-DisableWildcardHandling]
   [-Expression <String>]
   [-ForceWildcardHandling]
   -InputObject <IResultObject>
   [-NewName <String>]
   [-WhatIf]
   [<CommonParameters>]
Set-CMStatusMessageQuery [-Comment ] [-Confirm] [-DisableWildcardHandling] [-Expression ]
 [-ForceWildcardHandling] -Id  [-NewName ] [-WhatIf] []
Set-CMStatusMessageQuery [-Comment ] [-Confirm] [-DisableWildcardHandling] [-Expression ]
 [-ForceWildcardHandling] -Name  [-NewName ] [-WhatIf] []
Set-CMStatusMessageQuery [-Confirm] [-DeleteMessage] [-DisableWildcardHandling] [-ForceWildcardHandling]
 -Id  [-PassThru] [-WhatIf] []
Set-CMStatusMessageQuery [-Confirm] [-DeleteMessage] [-DisableWildcardHandling] [-ForceWildcardHandling]
 -Name  [-PassThru] [-WhatIf] []
Set-CMStatusMessageQuery [-Confirm] [-DeleteMessage] [-DisableWildcardHandling] [-ForceWildcardHandling]
 -InputObject  [-PassThru] [-WhatIf] []

Description

The Set-CMStatusMessageQuery cmdlet changes settings for a Microsoft System Center Configuration Manager status message query. Status message queries return status messages from a System Center Configuration Manager site database. You can modify a comment, a Windows Management Infrastructure (WMI) expression, or the name of a query.

You can use this cmdlet with the DeleteMessage parameter to delete messages that this query finds.

This cmdlet can also add or remove a security scope for a message query. Every status message query must belong to at least one security scope.

You can specify a name or ID for a query or use the Get-CMStatusMessageQuery cmdlet to obtain a query.

Examples

Example 1: Add a security scope

PS C:\> Set-CMStatusMessageQuery -Name "All Status Messages" -SecurityScopeAction AddMembership -SecurityScopeName "Scope22"

This command adds the security scope named Scope22 to the query named All Status Messages.

Example 2: Delete messages

PS C:\> Set-CMStatusMessageQuery -DeleteMessage -Name "All Active Directory Security Groups"

This command removes messages found by the query named All Active Directory Security Groups from the System Center Configuration Manager database.

Example 3: Rename a query

PS C:\> Set-CMStatusMessageQuery -Name "All Active Directory Security Groups" -NewName "Western Security Groups"

This command renames the query All Active Directory Security Groups. The new name of the query is Western Security Groups.

Required Parameters

-DeleteMessage

Indicates that messages found by this query are deleted from the Configuration Manager database.

Type:SwitchParameter
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Id

Specifies an ID for a status message query.

Type:String
Aliases:QueryId
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies a status message query object. To obtain a status message query object, use the Get-CMStatusMessageQuery cmdlet.

Type:IResultObject
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies a name for a status message query.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Comment
Type:String
Aliases:Comments
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Expression

Specifies an expression in WMI Query Language (WQL).

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

Indicates that wildcard handling is enabled.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NewName

Specifies a new name for a query.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False