' LogonTrack.vbs ' Logs each login in the Application Log as a success audit, to aid in logon tracking. Dim WSHShell Dim WSHNetW Set WSHShell = WScript.CreateObject("WScript.Shell") Set WshNetw = Wscript.CreateObject("Wscript.Network") servername = "some_server_monitored_by_Event_Sink" 'Name of the server on which you want the logons to be logged. ' Get the computer's IP address by looking at network adapters. for each Config in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("Win32_NetworkAdapterConfiguration") If VarType(Config.Ipaddress(0)) = 8 Then If not Config.Ipaddress(0) = "0.0.0.0" Then myip = Config.IPaddress(0) myMAC= Config.MACAddress(0) End If End If Next WSHShell.LogEvent 8, WSHNetw.computername &VbCrLf& myip &VbCrLf& myMAC &VbCrLf& NOW() &VbCrLf& WSHNetw.username, servername