Get-CMComponentStatusMessage
Get component status messages in Configuration Manager.
Syntax
Default (Default)
Get-CMComponentStatusMessage
[-ComponentName <String>]
[-ComputerName <String>]
[-Severity <Severity>]
[-SiteCode <String>]
-StartTime <DateTime>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
Description
The Get-CMComponentStatusMessage cmdlet gets component status messages for a specified period.
Configuration Manager indicates whether operations succeed or fail and include other information in component status messages. Threads or processes send component status messages to Configuration Manager sites, which are identified by site codes.
You can define which messages to get by the severity of the message, the component that created the message, the computer that hosts that component, or the Configuration Manager server that receives the message. Always specify a viewing period as a TimeSpan object.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
Examples
Example 1: Get error messages for a site
This example gets all messages with the error severity from a specific start time.
Get-CMComponentStatusMessage -StartTime "2/1/2013 12:00 AM" -Severity Error
Example 2: Get warning messages for a site within the last 24 hours
This example gets all warnings for a specific site in the last day.
Get-CMComponentStatusMessage -StartTime $(Get-Date).AddHours(-24) -Severity Warning -SiteCode "CM1"
Example 3: Get summary of messages for all components within last 24 hours
This example first uses the Get-CMSiteComponent cmdlet to get a list of all components from the current site. It pipes this list through several cmdlets to format the list, and then loops through each component. For each component, it gets the error and warning status messages for the last day. It then summarizes the number of errors and warnings for each component in the last day.
Note
This command can take several minutes to run.
PS OPC:\> Get-CMSiteComponent | Select-Object -ExpandProperty ComponentName -Unique | Sort-Object ComponentName | ForEach-Object {
$errs = $(Get-CMComponentStatusMessage -ComponentName $_ -Severity Error -StartTime $(Get-Date).AddHours(-24)).Count
$warns = $(Get-CMComponentStatusMessage -ComponentName $_ -Severity Warning -StartTime $(Get-Date).AddHours(-24)).Count
[pscustomobject]@{
Component = $_
Errors = $errs
Warnings = $warns
}
}
Component Errors Warnings
--------- ------ --------
SMS_AD_SECURITY_GROUP_DISCOVERY_AGENT 742 0
SMS_WSUS_SYNC_MANAGER 90 0
SMS_WSUS_CONFIGURATION_MANAGER 0 0
SMS_WSUS_CONTROL_MANAGER 62 0
SMS_AD_SYSTEM_DISCOVERY_AGENT 0 0
SMS_CLIENT_HEALTH 0 0
SMS_CLOUD_PROXYCONNECTOR 0 0
SMS_AD_USER_DISCOVERY_AGENT 0 612
...
Parameters
-ComponentName
Specifies the name of a thread or process. A thread or process sends a component status message.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | Component |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ComputerName
Scope the status messages results and specify the name of a computer that hosts a component.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | MachineName |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Severity
Specifies the severity of component status messages to get.
Note
This parameter currently doesn't work with the All
value, but also doesn't return any values if omitted.
Parameter properties
Type: | Severity |
Default value: | None |
Accepted values: | All, Error, Warning, Information |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-SiteCode
Specifies a site code from which to get component status messages.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-StartTime
Specify a time for the start of the viewing period for the component status messages.
Parameter properties
Type: | DateTime |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | ViewingPeriod |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.