Share via


RaiseWarningStatusMsg Method in Class SMS_StatusMessage

The RaiseWarningStatusMsg WMI class method creates a warning status message. Warnings indicate that your component is still functional, but may require the administrator's attention.

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

uint32 RaiseWarningStatusMsg(
  [in] string MessageText,
  [in] uint32 MessageType,
  [in, optional] uint32 Win32Error,
  [in, optional] uint32 ProcessID,
  [in, optional] uint32 ThreadID,
  [in, optional] datetime Time,
  [in, optional] uint32 AttrIDs[],
  [in, optional] string AttrValues[],
  [in, optional] string TopLevelSiteCode
);

Parameters

  • MessageText
    Data type: string
    Qualifiers: In

    Text of the status message. This property can contain up to 255 characters. It cannot include new-line or tab characters.

  • MessageType
    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.
  • Win32Error
    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.

  • ProcessID
    Data type: uint32
    Qualifiers: In, Optional

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

  • ThreadID
    Data type: uint32
    Qualifiers: In, Optional

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

  • Time
    Data type: datetimeQualifiers: In, Optional

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

  • AttrIDs
    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
  • AttrValues
    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.

  • TopLevelSiteCode
    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 RaiseWarningStatusMsg method returns an uint32 which is always zero (0).

Example Code

For an example that shows you how to raise a warning message, see Reporting Informational, Warning, and Error Status Messages.

Remarks

The RaiseWarningStatusMsg method sets the Severity property to 0x80000000. 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, RaiseRawStatusMSg, Reporting Informational, Warning, and Error Status Messages, SMS_StatusMessage, Using Status Messages