RaiseRawStatusMsg Method in Class SMS_StatusMessage

System Center

The RaiseRawStatusMsg WMI class method creates a status message from an external message DLL. Unlike the other raise methods that store the message text in the database, the RaiseRawStatusMsg method has you specify a MessageID that identifies a message in the message DLL.

The following syntax is simplified from MOF code and is intended to show you the definition of the method.

uint32 RaiseRawStatusMsg(
  [in] string ModuleName,
  [in] uint32 MessageType,
  [in, Range("0-65535")] uint32 MessageID,
  [in, optional] uint32 Win32Error,
  [in, optional] uint32 ProcessID,
  [in, optional] uint32 ThreadID,
  [in, optional] datetime Time,
  [in, optional] string InsStrings[],
  [in, optional] uint32 AttrIDs[],
  [in, optional] string AttrValues[],
  [in, optional] string TopLevelSiteCode


Data type: string
Qualifiers: In

DLL associated with the status message you wish to raise. This is not the name of the DLL itself, but a display string corresponding to the ModuleName property value defined in the SMS_StatMsgModuleNames class.

Data type: uint32
Qualifiers: In

This parameter can contain the following values.

Message type value Description
256 Use the Milestone message type at the end of an operation to indicate the operation's success or failure. If the operation was successful, you would use the Milestone type in an informational message. If the operation failed, you would use a Milestone message type in a warning or error message.
512 : Use the Detail message type to illustrate the steps in a complex operation. Often, detail messages are meaningful only within the context of the sequence of status messages representing a complex operation.
768 Use the audit message type for informational messages that provides a trail of actions taken by the SMS Administrator. An audit message also depicts an operation that results in objects being added, modified, or deleted. You need not create audit messages; the provider automatically generates these messages for you.
1024 : This value is not used.

Data type: uint32
Qualifiers: In

Uniquely identifies the message text in the message DLL. This value is formatted as a Win32 error code and must be joined with a logical OR with a Severity value to create a resource string ID. For a list of Severity values, see SMS_StatusMessage.

The MessageID range is 0 - 65535. You should use values in the range 40,000 to 49,999. This ensures that your values do not conflict with the values used by SMS components.

Data type: uint32
Qualifiers: In, Optional

Win32 error code associated with the status message, from a call of the GetLastError function. The Status Message Viewer gets the text associated with the error code and concatenates it to your message text.

Data type: uint32
Qualifiers: In, Optional

Identifier of the process which created the message. It defaults to zero.

Data type: uint32
Qualifiers: In, Optional

Identifier of the thread which created the message. It defaults to zero.

Data type: datetimeQualifiers: In, Optional

Date and time (Greenwich mean time) when the status message was created. It defaults to the current time.

Data type: string[]
Qualifiers: In, Optional

Array of insertion strings used for filling in the insertion points in the message text. The insertion string length is limited to 255 characters and your message text is limited to 10 insertion points.

Data type: uint32[]
Qualifiers: In, Optional

Identifies the type of attributes contained in the AttrValues parameter. Each value in the AttrIDs array must correspond with a value in the AttrValues array.

Value Meaning
400 AttrValues contains a PackageID.
401 AttrValues contains an AdvertisementID.
402 AttrValues contains a CollectionID.
403 AttrValues contains a UserName.
404 AttrValues contains a DistributionPoint.

Data type: string[]
Qualifiers: In, Optional

Attributes to associate with the status message. Each value in the AttrValues array must correspond with a "legal" value in the AttrIDs array.

You do not provide the UserName pair — the SMS Provider automatically sets this attribute pair for you.

Data type: string
Qualifiers: In, Optional

By specifying a site code for this parameter, you are overriding the status message filter rules. This site code instructs the status manager not to propagate the message any higher in the hierarchy than the specified site. This is useful if higher-level sites have no knowledge of the objects being referred to in the status message.

Return Values

The RaiseRawStatusMsg method returns a uint32 which is always zero (0).

Example Code

For an example that shows you how to raise a raw message, see Reporting Raw Status Messages.


When you call this method, you must set the context qualifiers, ApplicationName and MachineName, to their respective names, which are then used by this method to set the values of properties Component and MachineName respectively in the SMS_StatusMessage class.

See Also

RaiseErrorStatusMSg, RaiseInformationalStatusMSg, RaiseWarningStatusMSg, Reporting Raw Status Messages, SMS_StatusMessage, SMS_StatMsgModuleNames, Using Status Messages