is it possible to have the timestamp of when the current user logged in windows?
i couldn't find it in win32_computersystem. for the moment i use the detectiontime
my code:
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colComputer
Wscript.Echo "<USERHISTO>"
Wscript.Echo "<LOGONUSERNAME>"
Wscript.Echo objComputer.UserName
Wscript.Echo "</LOGONUSERNAME>"
Wscript.Echo "<DETECTION>"
Wscript.Echo year(date) & "-" & month(date) & "-" & day(date) & "T" & time & "+00:00"
Wscript.Echo "</DETECTION>"
Wscript.Echo "</USERHISTO>"
Next