Not sure if this is what you are asking but I track logons with a logon script 
that writes to a csv file on a server share.  You could modify it a bit and add 
a second script to track logoffs. It is the only thing I have found to be 
reliable.  Then I have a scheduled task each night to rename 'log.csv' to 
today's date and recreate a new 'log.csv' for the next day. It gives me 
computername, username, ip and time.  WARNING, very bad things happen if the 
server share becomes unavailable using my system. I would suggest using a 
couple of server shares and dfs them for fail over.

strComputer = objNetwork.ComputerName
Set objWMIService = GetObject( _ 
    "winmgmts:\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery _
    ("Select IPAddress from Win32_NetworkAdapterConfiguration ")
 
For Each IPConfig in IPConfigSet
    If Not IsNull(IPConfig.IPAddress) Then 
        For i=LBound(IPConfig.IPAddress) _
            to UBound(IPConfig.IPAddress)
                strIPAddress = strIPAddress & "," & IpConfig.IpAddress(i)
        Next
    End If
Next
 
strInfo = objNetwork.ComputerName & "," & objNetwork.UserName & "," & Date() & 
"," & Time() & "," & StrIPAddress


SET objFSO = CreateObject("Scripting.FileSystemObject")
SET objOutputFile = objFSO.OpenTextFile("\\SERVER\Logs\log.csv", ForAppend, 
False)
objOutputfile.writeline strInfo
objFSO.Close

-----Original Message-----
From: Rankin, James R [mailto:[email protected]] 
Sent: Wednesday, August 15, 2012 2:28 PM
To: NT System Admin Issues
Subject: Offline/online detection

What's the best way to detect whether a user is offline or online (I.e. 
Connected to the corporate network)? I thought maybe query the %logonserver% 
variable but that might also apply to online situations where a DC cannot be 
contacted for whatever reason. I'm sure there must be a way, wondering if 
anyone has any ideas they can throw out?


TIA,



JR

---Blackberried

~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ 
<http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

Reply via email to