Remove-CMStatusMessageQuery

Removes a Configuration Manager status message query.

Syntax

Remove-CMStatusMessageQuery
      -InputObject <IResultObject>
      [-Force]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMStatusMessageQuery
      -Id <String>
      [-Force]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Remove-CMStatusMessageQuery
      -Name <String>
      [-Force]
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-CMStatusMessageQuery cmdlet removes a status message query from Configuration Manager. Status message queries return status messages from the Configuration Manager site database.

Note

Configuration Manager cmdlets must be run from the Configuration Manager site drive. The examples in this article use the site name XYZ. For more information, see the getting started documentation.

Examples

Example 1: Remove a named query

PS XYZ:\> Remove-CMStatusMessageQuery -Name "All Audit Status Messages from a Specific Site"
Remove
Are you sure you wish to remove StatusMessageQuery: Name="All Audit Status Messages from a Specific Site"?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):

This command removes a query named All Audit Status Messages from a Specific Site. The command does not include the Force parameter, so the cmdlet prompts you before it removes the query.

Example 2: Remove a query that has a specified ID

PS XYZ:\> Remove-CMStatusMessageQuery -Id "CM100008" -Force

This command removes the query that has an ID of CM100008. The command includes the Force parameter, so the cmdlet does not prompt you for confirmation.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

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

Forces the command to run without asking for user confirmation.

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

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

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

Specifies an ID of a status message query.

Type:String
Aliases:QueryId
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
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies a name of a status message query.

Type:String
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
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

System.Object