Export (0) Print
Expand All
Expand Minimize

New-CMStatusMessageQuery

Updated: September 1, 2013

Applies To: System Center 2012 Configuration Manager SP1

New-CMStatusMessageQuery

Creates a status message query.

Syntax

Parameter Set: NewStatusMessageQuery
New-CMStatusMessageQuery -Name <String> [-Comments <String> ] [-Expression <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

The New-CMStatusMessageQuery cmdlet creates a status message query in Microsoft System Center 2012 Configuration Manager. Status message queries in System Center 2012 Configuration Manager return status messages from the site database. All major System Center 2012 Configuration Manager components generate status messages.

Parameters

-Comments<String>

Specifies a description for the status message query.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Expression<String>

Specifies WMI Query Language (WQL) text for the query.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies a name for the 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 executing the command.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.


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.

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: Create a status message query

This command creates a status message query named Client Component Configuration Changes and Fatal Errors. The Expression parameter specifies the WMI Query Language (WQL) text for the query.


PS C:\> New-CMStatusMessageQuery -Name "Client Component Configuration Changes and Fatal Errors" -Expression "select stat.*, ins.*, att1.*, stat.Time from SMS_StatusMessage as stat left join SMS_StatMsgInsStrings as ins on stat.RecordID = ins.RecordID left join SMS_StatMsgAttributes as att1 on stat.RecordID = att1.RecordID where stat.ModuleName = 'SMS Client' and stat.MessageID = 669 and stat.SiteCode = ##PRM:SMS_StatusMessage.SiteCode## and stat.Time >= ##PRM:SMS_StatusMessage.Time## order by stat.Time desc"

Related topics

 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft