Partager via


ConfigMgrStateMessage Class

 

Sends state messages to the management point. If you need to send a message to a fallback status point, use ConfigMgrFspStateMessage instead.

Namespace:   Microsoft.ConfigurationManagement.Messaging.Messages
Assembly:  Microsoft.ConfigurationManagement.Messaging (in Microsoft.ConfigurationManagement.Messaging.dll)

Inheritance Hierarchy

System.Object
  Microsoft.ConfigurationManagement.Messaging.Framework.Message
    Microsoft.ConfigurationManagement.Messaging.Framework.AsynchronousMessage
      Microsoft.ConfigurationManagement.Messaging.Messages.ConfigMgrInventoryMessage
        Microsoft.ConfigurationManagement.Messaging.Messages.ConfigMgrRelayMessage
          Microsoft.ConfigurationManagement.Messaging.Messages.ConfigMgrStateMessage
            Microsoft.ConfigurationManagement.Messaging.Messages.ConfigMgrFspStateMessage

Syntax

[SerializableAttribute]
[MessageSupportAttribute(MessageSupportStatus.Supported)]
[MessageClassAttribute(MessageClassAttributeSetting.None)]
public class ConfigMgrStateMessage : ConfigMgrRelayMessage
[SerializableAttribute]
[MessageSupportAttribute(MessageSupportStatus::Supported)]
[MessageClassAttribute(MessageClassAttributeSetting::None)]
public ref class ConfigMgrStateMessage : ConfigMgrRelayMessage
<SerializableAttribute>
<MessageSupportAttribute(MessageSupportStatus.Supported)>
<MessageClassAttribute(MessageClassAttributeSetting.None)>
Public Class ConfigMgrStateMessage
    Inherits ConfigMgrRelayMessage

Constructors

Name Description
System_CAPS_pubmethod ConfigMgrStateMessage()

Initializes a new instance of the ConfigMgrStateMessage class.

Properties

Name Description
System_CAPS_pubproperty Attachments

Gets message attachments. (Inherited from Message.)

System_CAPS_pubproperty Body

Gets the message body. This property should not be empty, with limited exceptions.(Inherited from Message.)

System_CAPS_protproperty BodyAsAttachment

Indicates whether relay messages send the body as an attachment. (Inherited from ConfigMgrRelayMessage.)

System_CAPS_pubproperty ClientVersion

Gets or sets the client version for the client sending the state message. If you don't set this property, a random version will be set. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_pubproperty CodePage

Gets or sets the code page for the message. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_protproperty DiscoveredNetBiosName

Gets a value that indicates whether the NetBiosName property was derived from discovery. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_protproperty FileType

Gets the file type for state messages. (Overrides ConfigMgrRelayMessage.FileType.)

System_CAPS_pubproperty FullStateMessage

Do not use. This property builds an entire state message from scratch. StateMessage uses defaults.

System_CAPS_pubproperty IncludeMachinePublicKey

Gets or sets a value that indicates whether, when the BuildInventoryMessage method is used, a public key will be included in the inventory report. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_pubproperty InventoryReport

Gets or sets the entire serialized inventory message. The BuildInventoryMessage method should be used to initialize the message; we don't recommend setting everything manually. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_pubproperty LocaleId

Gets or sets the locale ID for state messages. The default value is the locale ID for the current process. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_pubproperty MessageId

Gets the internal ID of a message. (Inherited from Message.)

System_CAPS_pubproperty NetBiosName

Gets or sets the NetBIOS name of the computer that generates the state message. If you don't set this value, the name of the executing machine is used. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_protproperty PostSendActionsSupported

Gets a value that indicates whether the message supports post-send actions. (Inherited from Message.)

System_CAPS_pubproperty Priority

Gets the priority for a message. This property is only used for reference by senders and has no effect on the message. (Inherited from Message.)

System_CAPS_pubproperty ReportContentType

Gets the report content type for state messages. (Overrides ConfigMgrInventoryMessage.ReportContentType.)

System_CAPS_pubproperty ReportFormat

Gets or sets the report format. The default report format is 1.1. This property can be overridden by inheriting classes. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_pubproperty ReportVersion

Gets or sets the report version. The default report version is 1.0. This property can be overridden by inheriting classes (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_protproperty RequireXmlHeader

If true, an XML header is required. If false, an XML header is not required (such as for a fallback status point).

System_CAPS_pubproperty SenderCallback

Gets a sender callback for a message. This property is null unless a message is in the process of being sent. (Inherited from Message.)

System_CAPS_pubproperty SenderType

Gets the sender type for a message. This property is only used for reference by senders and has no effect on the message. (Inherited from Message.)

System_CAPS_pubproperty Settings

Gets message settings. (Inherited from Message.)

System_CAPS_pubproperty SiteCode

Gets or sets the site code for the message. This property is optional. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_pubproperty SmsId

Gets or sets the SMSID used for the message. This property must be set for inventory messages. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_pubproperty StateMessages

Gets the state message to be sent to the management point.

System_CAPS_protproperty StateMessageType

Gets or sets the state message type.

System_CAPS_protproperty SupportsInlineSerializers

Gets a value that indicates whether Serialize() is called on send and DeserializeMessageBody is called on receive.

The default setting for this property is true. Override to false with caution. (Inherited from Message.)

Methods

Name Description
System_CAPS_pubmethod AddCertificateToMessage(MessageCertificateX509, CertificatePurposes)

Adds a certificate to the message. (Inherited from Message.)

System_CAPS_pubmethod AddCertificateToMessage(MessageCertificateX509, CertificatePurposes, Boolean)

Adds a certificate to a message with the option to disable any intelligence. (Inherited from Message.)

System_CAPS_pubmethod AddStateMessage(StateMessage)

Adds a state message to the internal store to send to the management point or fallback status point.

System_CAPS_pubmethod BuildInventoryMessage(Collection<InventoryReportBodyElement>)

Constructs an inventory report from an InventoryReportBodyElement object array. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_pubmethod BuildInventoryMessage(Collection<InventoryReportBodyElement>, Boolean)

Constructs an inventory report from an InventoryReportBodyElement object array. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_pubmethod BuildInventoryMessage(InventoryReportBodyElement)

Constructs an inventory report from an InventoryReportBodyElement object by using default settings. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_pubmethod BuildInventoryMessage(InventoryReportBodyElement, Boolean)

Constructs an inventory report from an InventoryReportBodyElement object by using default settings. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_pubmethod CloneBase()

Creates a clone of a message.

Important: This method is not the same as nor does it behave the same as Clone. That is why this message type does not implement ICloneable. It is not recommended that any code outside of Messaging core code use this function without understanding how it works, what its limitations are, and why it's being used.

Note: If you're considering this method, ensure that you have evaluated CloneByRef which you might want to use instead. (Inherited from Message.)

System_CAPS_pubmethod CloneByRef(IMessage)

Clones a reference of a message. Use this method to create a copy of an existing message, especially one of a different type, into this message.

Important: This method is not the same as nor does it behave the same as Clone. That is why this message type does not implement ICloneable. It is not recommended that any code outside of Messaging core code use this function without understanding how it works, what its limitations are, and why it's being used. (Inherited from Message.)

System_CAPS_pubmethod CloneByRef(IMessage, MessageCloneOptions)

Clones a reference of a message. Use this method to create a copy of an existing message, especially one of a different type, into this message.

Important: This method is not the same as nor does it behave the same as Clone. That is why this message type does not implement ICloneable. It is not recommended that any code outside of Messaging core code use this function without understanding how it works, what its limitations are, and why it's being used. (Inherited from Message.)

System_CAPS_protmethod CriticalSection(Action)

Invokes a statement within a thread-safe critical section. (Inherited from Message.)

System_CAPS_protmethod CriticalSection<T>(Func<T>)

Invokes a statement within a thread-safe critical section. (Inherited from Message.)

System_CAPS_pubmethod DeserializeMessageBody()

Internal handler for deserializing a payload into its object format. This method should only be called by external code under exceptional circumstances. (Inherited from Message.)

System_CAPS_pubmethod Discover()

Performs discovery. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetCertificateFromMessage(CertificatePurposes)

Retrieves the X509-based certificate from a message. (Inherited from Message.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod InstancesContainsElementOfType(IList<InventoryReportBodyElement>, Tuple<Type, Boolean>[])

Verifies whether a particular type of instance is contained in a collection of elements. (Inherited from ConfigMgrInventoryMessage.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod OnDeserialization(Object)

Ensures validity checks are never performed on deserialization. (Inherited from Message.)

System_CAPS_pubmethod PostSendActions(IMessageSender, Boolean)

Actions that run after a message is sent. This is an asynchronous action; use with caution. (Inherited from Message.)

System_CAPS_pubmethod PreSendActions()

Performs pre-send actions. (Inherited from ConfigMgrRelayMessage.)

System_CAPS_protmethod SendInlineStatusMessage(SmsEvent, IMessageSender)

Sends a status message. This is a synchronous operation and should be called from a separate thread to avoid blocking. (Inherited from Message.)

System_CAPS_protmethod SendInlineStatusMessage(StatusMessage, IMessageSender)

Sends a status message. This is a synchronous operation and should be called from a separate thread to avoid blocking. (Inherited from Message.)

System_CAPS_pubmethod SendMessage(IMessageSender)

Sends the message using the specified sender.(Inherited from AsynchronousMessage.)

System_CAPS_protmethod SendMessageAsync(IMessageSender)

Sends a message by using the specified sender. (Inherited from Message.)

System_CAPS_protmethod SendMessageSync<T>(IMessageSender)

Sends a message by using the specified sender. (Inherited from Message.)

System_CAPS_pubmethod SerializeMessageBody()

Serializes the payload. (Overrides ConfigMgrInventoryMessage.SerializeMessageBody().)

System_CAPS_protmethod SimpleBodyDeserialization<T>()

Helper function that deserializes an object from the existing payload. (Inherited from Message.)

System_CAPS_protmethod SimpleBodyDeserialization<T>(DeserializationArguments)

Helper function that deserializes an object from the existing payload. (Inherited from Message.)

System_CAPS_protmethod SimpleObjectSerialization(Object)

Helper function that serializes an object to a payload. (Inherited from Message.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_pubmethod Validate()

Obsolete. Validates that all required message settings are present and meet the requirements. If this method fails, the message will likely fail in being sent or processed by the site or management point. (Inherited from Message.)

System_CAPS_pubmethod Validate(IMessageSender)

Validates that all required message settings are present and meet the requirements. If this validation fails, the message is almost certain to fail in being sent or processed by the site or management point. (Inherited from Message.)

Fields

Name Description
System_CAPS_protfield Synchronizer

Synchronizer to use for locking in thread-safe operations. (Inherited from Message.)

Explicit Interface Implementations

Name Description
System_CAPS_pubinterfaceSystem_CAPS_privmethod IMessage.SendMessage(IMessageSender)

Sends a message by using the specified sender. (Inherited from Message.)

System_CAPS_pubinterfaceSystem_CAPS_privproperty IMessageBase.Settings

Gets message properties and settings. (Inherited from Message.)

Examples

// Create new sender instance
HttpSender sender = new HttpSender();
ConfigMgrStateMessage message = new ConfigMgrStateMessage();

// Add signing certificate to the message
message.AddCertificateToMessage(new MessageCertificateX509Volatile("MyCertificate.pfx", "password"), CertificatePurposes.Signing);
message.Settings.HostName = "MyManagementPoint";

// Create a state message object and add it the message
StateMessage stateMessage = new StateMessage();
stateMessage.State.Id = StateMessageStateId.ClientFrameworkModeReadinessReady;
stateMessage.State.Criticality = 0;
stateMessage.Topic.Id = "CCM Framework Mode Readiness";
stateMessage.Topic.IdType = StateMessageTopicIdType.FrameworkState;
stateMessage.StateDetails = new StateDetails();
stateMessage.StateDetails.StateDetailsContents = new StateDetailsContentsClientIdentity(true);
stateMessage.UserParameters.AddStateMessageParameter(0);
stateMessage.UserParameters.AddStateMessageParameter(Environment.MachineName);

message.AddStateMessage(stateMessage);

// Send the message to the management point
message.SendMessage(sender);

Thread Safety

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

ConfigMgrFspStateMessage
Microsoft.ConfigurationManagement.Messaging.Messages Namespace

Return to top