If you're using VBScript you can do the following to get the user name, computer name and time logged on:
We do something very similar to what you're looking at. We just run a vbscript in a logon and logoff script to record user name, computer name and date/time into a text file. I can post the whole code if you're interested.
Dim wsShell, ComputerName, UserName, LogonDateTime