Question Locked

User Last Logged In From...?

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello,

Is there a feature in Windows Server 2000/2003 or maybe a program I can obtain that will give me the last computer that a person connected from? For instance, I want to keep track of what users are connecting from what computers. I would like to be able to select a user from our domain and see which computer he is/was connected from. Is this possible?

Thanks!!

2 replies

by Member 25348569

attached to an all-users GPO. Just change the Data folder location. It writes a "User" and a "Computer" file with the same information. I also use a similar script for the logout but targeted to a different location. Use an Admin $ share and the users will never know that we know when they REALLY started work...

[pre]
Const ForAppending = 8

Dim sDatafolder, oNetwork, oFSO, sUserName, sComputerName

' Set environment

sDataFolder = "User Logon data file share"

' Get Session objects

Set oNetwork = CreateObject("WScript.Network")
Set oFSO = CreateObject("Scripting.FileSystemObject")

' Get basic user info

sUserName = oNetwork.UserName
sComputerName = oNetwork.ComputerName

' Write workstation file

LogData sDataFolder & sComputerName & ".log"

' Write user log file

LogData sDataFolder & sUserName & ".log"

' Tidy up and exit

Set oNetwork = Nothing
Set oFSO = Nothing

wscript.Quit(0)

' -----------------------------

' Subs and Functions

Sub LogData(sFileName)

' Open file (create if needed), append new data and close

Dim oDatafile

Set oDataFile = oFSO.OpenTextFile(sFileName, ForAppending, True)
oDataFile.WriteLine FormatDateTime(date,vbShortDate) & _
vbTab & FormatDateTime(time,vbShortTime) & _
vbTab & sComputerName & vbTab & sUserName
oDataFile.Close
Set oDataFile = Nothing

End Sub

[/pre]

This discussion is closed to new replies.