The Win32_LogonSession class describes the logon session or sessions associated with a user who has logged on to Windows NT or Windows 2000.

Quick Start


In this WMI class, all WMI properties are read-only. You can only read values but not change them.


Data type String

The AuthenticationPackage is the name of the subsystem used to authenticate the logon session.


Data type String

The Caption property is a short textual description (one-line string) of the object.


Data type String

The Description property provides a textual description of the object.


Data type DateTime

The InstallDate property is datetime value indicating when the object was installed. A lack of a value does not indicate that the object is not installed.


Data type String

The LogonId is the ID assigned to the logon session. The application that initiated the session should have called AllocateLocallyUniqueId in order to generate this ID.


Data type UInt32

The LogonType is a numeric value indicating what type of logon session this is.

System – Interactive – This logon type is intended for users who will be interactively using the machine, such as a user being logged on by a terminal server, remote shell, or similar process.

Network – This logon type is intended for high performance servers to authenticate clear text passwords. LogonUser does not cache credentials for this logon type.

Batch – This logon type is intended for batch servers, where processes may be executing on behalf of a user without their direct intervention; or for higher performance servers that process many clear-text authentication attempts at a time, such as mail or web servers. LogonUser does not cache credentials for this logon type.

Service – Indicates a service-type logon. The account provided must have the service privilege enabled.

Proxy – Proxy logon. This logon type is not supported.

Unlock – This logon type is intended for GINA DLLs logging on users who will be interactively using the machine. This logon type allows a unique audit record to be generated that shows when the workstation was unlocked.

Network Cleartext – Windows 2000: This logon type preserves the name and password in the authentication packages, allowing the server to make connections to other network servers while impersonating the client. This allows a server to accept clear text credentials from a client, call LogonUser, verify that the user can access the system across the network, and still communicate with other servers.

New Credentials – Windows 2000: This logon type allows the caller to clone its current token and specify new credentials for outbound connections. The new logon session has the same local identify, but uses different credentials for other network connections.

$LogonType_ReturnValue = 


Data type String

The Name property defines the label by which the object is known. When subclassed, the Name property can be overridden to be a Key property.


Data type DateTime

The StartTime property represents the time at which the session started.


Data type String

The Status property is a string indicating the current status of the object. Various operational and non-operational statuses can be defined. Operational statuses are “OK”, “Degraded” and “Pred Fail”. “Pred Fail” indicates that an element may be functioning properly but predicting a failure in the near future. An example is a SMART-enabled hard drive. Non-operational statuses can also be specified. These are “Error”, “Starting”, “Stopping” and “Service”. The latter, “Service”, could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is on-line, yet the managed element is neither “OK” nor in one of the other states.

'OK','Error','Degraded','Unknown','Pred Fail','Starting','Stopping','Service','Stressed','NonRecover','No Contact','Lost Comm'



See Also

Help and Questions

  Community Content

You are cordially invited to add knowledge to this page. If you have sample code or additional information related to this WMI class, please share it. Use the comment form to send your information. We will edit and incorparate it into the reference library. Thank you!

Please do not use the comment form to submit questions. If you have questions or need assistance, visit our free forum: Help me with WMI.

Content last updated: 2013-12-27 12:19:58 (UTC).