2.2.2.12 USER_EVENT Message

The Data field of a PSRP message specifies a USER_EVENT message when the MessageType field has a value of 0x00021008.

In messages of this type, the Data field is UTF-8 encoded XML, equivalent to the XML created by serializing a Complex Object (section 2.2.5.2) with the following extended properties (see section 2.2.5.2.9).

  • Event identifier

    • Property name: PSEventArgs.EventIdentifier.

    • Property type: Signed int (see section 2.2.5.1.11).

  • Source identifier

    • Property name: PSEventArgs.SourceIdentifier.

    • Property type: String (see section 2.2.5.1.1).

  • Time when event was generated

    • Property name: PSEventArgs.TimeGenerated.

    • Property type: Date/Time (see section 2.2.5.1.4).

  • Sender of the event

    • Property name: PSEventArgs.Sender.

    • Property type: Any Primitive Type Object (section 2.2.5.1) or Complex Object (section 2.2.5.2).

  • Event arguments

    • Property name: PSEventArgs.SourceArgs.

    • Property type: Any Primitive Type Object (section 2.2.5.1) or Complex Object (section 2.2.5.2).

  • Message data

    • Property name: PSEventArgs.MessageData.

    • Property type: Any Primitive Type Object (section 2.2.5.1) or Complex Object (section 2.2.5.2).

  • Name of the computer where the event was fired.

    • Property name: PSEventArgs.ComputerName.

    • Property type: Null (see section 2.2.5.1.20) or String (see section 2.2.5.1.1).

  • ID of the runspace.

    • Property name: PSEventArgs.RunspaceId.

    • Property type: GUID (see section 2.2.5.1.18).

The Complex Object described in this section SHOULD have no associated type names (section 2.2.5.2.3).

Example:

 <Obj RefId="0">
   <MS>
     <I32 N="PSEventArgs.EventIdentifier">1</I32>
     <S N="PSEventArgs.SourceIdentifier">ae6245f2-c179-4a9a-a039-47b60fc44500</S>
     <DT N="PSEventArgs.TimeGenerated">2009-06-17T10:57:23.1578277-07:00</DT>
     <Obj N="PSEventArgs.Sender" RefId="1">
       <TN RefId="0">
         <T>System.Timers.Timer</T>
         <T>System.ComponentModel.Component</T>
         <T>System.MarshalByRefObject</T>
         <T>System.Object</T>
       </TN>
       <ToString>System.Timers.Timer</ToString>
       <Props>
         <B N="AutoReset">true</B>
         <B N="Enabled">true</B>
         <Db N="Interval">5000</Db>
         <Nil N="Site" />
         <Nil N="SynchronizingObject" />
         <Nil N="Container" />
       </Props>
     </Obj>
     <Obj N="PSEventArgs.SourceArgs" RefId="2">
       <TN RefId="1">
         <T>System.Object[]</T>
         <T>System.Array</T>
         <T>System.Object</T>
       </TN>
       <LST>
         <Ref RefId="1" />
         <Obj RefId="3">
           <TN RefId="2">
             <T>System.Timers.ElapsedEventArgs</T>
             <T>System.EventArgs</T>
             <T>System.Object</T>
           </TN>
           <ToString>System.Timers.ElapsedEventArgs</ToString>
           <Props>
             <DT N="SignalTime">2009-06-17T10:57:23.1568275-07:00</DT>
           </Props>
         </Obj>
       </LST>
     </Obj>
     <Nil N="PSEventArgs.MessageData" />
     <Nil N="PSEventArgs.ComputerName" />
     <G N="PSEventArgs.RunspaceId">fb9c87e8-1190-40a7-a681-6fc9b9f84a17</G>
   </MS>
 </Obj>