Export (0) Print
Expand All
Expand Minimize

Set-CMStatusMessageQuery

Updated: September 1, 2013

Applies To: System Center 2012 Configuration Manager SP1

Set-CMStatusMessageQuery

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

Syntax

Parameter Set: DeleteMessageByIdMandatory
Set-CMStatusMessageQuery -DeleteMessage -Id <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: DeleteMessageByNameMandatory
Set-CMStatusMessageQuery -DeleteMessage -Name <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: DeleteMessageByObjectMandatory
Set-CMStatusMessageQuery -DeleteMessage -InputObject <IResultObject> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetSecurityScopeById
Set-CMStatusMessageQuery -Id <String> -SecurityScopeAction <SecurityScopeActionType> {AddMembership | RemoveMembership} -SecurityScopeName <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetSecurityScopeByName
Set-CMStatusMessageQuery -Name <String> -SecurityScopeAction <SecurityScopeActionType> {AddMembership | RemoveMembership} -SecurityScopeName <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetSecurityScopeByValue
Set-CMStatusMessageQuery -InputObject <IResultObject> -SecurityScopeAction <SecurityScopeActionType> {AddMembership | RemoveMembership} -SecurityScopeName <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SetStatusMessageQueryByIdMandatory
Set-CMStatusMessageQuery -Id <String> [-Comments <String> ] [-Expression <String> ] [-NewName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

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

Parameter Set: SetStatusMessageQueryByObjectMondatory
Set-CMStatusMessageQuery -InputObject <IResultObject> [-Comments <String> ] [-Expression <String> ] [-NewName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

The Set-CMStatusMessageQuery cmdlet changes settings for a Microsoft System Center 2012 Configuration Manager status message query. Status message queries return status messages from a System Center 2012 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. For more information about security scopes, see Planning for Security in Configuration Manager in the TechNet library at http://go.microsoft.com/fwlink/?LinkId=268426.

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

Parameters

-Comments<String>

Specifies a comment for a query.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DeleteMessage

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


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Expression<String>

Specifies an expression in WMI Query Language (WQL).


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Id<String>

Specifies an ID for 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 for a status message query.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-NewName<String>

Specifies a new name for a query.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SecurityScopeAction<SecurityScopeActionType>

Specifies a type of security action. Valid values are: AddMembership or RemoveMembership.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SecurityScopeName<String>

Specifies the name of a security scope. This value can be Default or a custom security scope.


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: Add a security scope

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


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

Example 2: Delete messages

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


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

Example 3: Rename a query

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


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

Related topics

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