Remove-CMStatusMessageQuery

Remove-CMStatusMessageQuery

Removes a Configuration Manager status message query.

Syntax

Parameter Set: SearchByIdMandatory
Remove-CMStatusMessageQuery -Id <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByNameMandatory
Remove-CMStatusMessageQuery -Name <String> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SearchByValueMandatory
Remove-CMStatusMessageQuery -InputObject <IResultObject> [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

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

Parameters

-Force

Forces the command to run without asking for user confirmation.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Id<String>

Specifies an ID of a status message query.

Aliases

QueryId

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InputObject<IResultObject>

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

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies a name of a status message query.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

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, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Remove a named query

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.

PS C:\> Remove-CMStatusMessageQuery -Name "All Audit Status Messages from a Specific Site"

Example 2: Remove a query that has a specified ID

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.

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

Get-CMStatusMessageQuery

New-CMStatusMessageQuery

Set-CMStatusMessageQuery