ProcessOSUser Property (IMessageSendNames Interface)

                    

 

ProcessOSUser  is a read-only property of the IMessageSendNames interface that returns the message parameter name expected by the MessageLog2.SendLogMessage method for specifying the O/S user associated with the process.

 

The ProcessOSUser is automatically added to all messages sent with MessageLog2.SendLogMessage.  This is typically the authenticated user of the application which is logging the message however this is not always the case. For applications that do impersonation, the identity of the impersonating thread posting a message may differ from the process identity.  This is because different threads may have different identities and also because the request to log may be invoked on one thread but is executed on the thread where the MessageLog2 object was instantiated (for single threaded apartment objects such as the MessageLog and MessageLog2).  For this reason only the process identity is automatically recorded but may be overridden by the application with this parameter.  Even without impersonation it is also possible that an application is doing work, and logging a message in that regard, on behalf of a different user (application servers behave this way).  For that case, the application should specify the OriginatingOSUser field when sending a message to provide a more accurate picture of the message context.

 

Syntax

object.ProcessOSUser

The object placeholder is an object expression that evaluates to a IMessageSendNames  interface.

 

Remarks
The IMessageSendNames interface can be obtained directly from the MessageLog2.MessageSendNames property or by using QueryInterface (assignment, in VB, casting in .Net) on a MessageLog or MessageLog2 object.

When adding to the NamedValues collection, the IMessageSendNames interface acts with Intellisense to show the available parameter options and ensures only names that are supported are used.

Enabling Operational Intelligence