Using WMI, Win32Session is a great start. In addition, it should be noted that if you are online, you can use Win32_NetworkLoginProfile to get all kinds of information.
Set logins = objWMIService.ExecQuery _ ("select * from Win32_NetworkLoginProfile") For Each objSession in logins Wscript.Echo objSession.LastLogon Next
Other bits of information that you can collect include the username, the last logout, as well as various materials related to the profile.
source share