Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding on which pc a domain user is logged? 1

Status
Not open for further replies.

veenma

Technical User
Jan 31, 2003
9
0
0
CH
I would a vbscript able to tell me where a domain user is logged. I mean on which ipaddress or computername a user is logged. I would also like to know if the same is logged on other computers at the same time.
exemple :
user pat is logged on 192.168.0.25 and on 192.168.0.26 at the same time.

Thanks for advising me

Hoping to have responses as soon as possible
 
i've got a vb script that runs from the login script that makes logs like what u want.
cept you'll have to wait till monday. then i can post it here for you.
===============
Security Forums
 
First of all, thanx for replying
infact i would like to locate where domain users log all day long by searching by their username (i.e. pat).
If a user connects on two or three different pcs, i would like to know the name of the pc on which he is connected, or the ip adress, as well as the date, the time.

If you could help me with that it would be very nice.

Thanx again
 
that works too.
my script creates 2 lots of log files. one for each computer and one for each user.
the computer one lists which users have used that computer and the user one lists which computers a user has used :)

on error resume next
'wscript.echo "Logging....."
const ForAppending = 8
dim net,fso,f
Set net = WScript.CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")
set wshell = wscript.createobject("wscript.shell")
Set WshSysEnv = WShell.Environment("SYSTEM")


'uname = net.username
uname = wshell.ExpandEnvironmentStrings("%USERNAME%")
'wscript.echo "! " & uname

datetemp = date
ttemp = time
cname = net.ComputerName
'cname = wshell.ExpandEnvironmentStrings("%COMPUTERNAME%")

'path1=list of ppl who have used computer cname
'path2=list of computers person uname has used
'path3=list of shortcuts install in startmenu

path1 = "\\server\logs\" & lcase(cname) & ".txt"
path2 = "\\server\logs\" & lcase(uname) & ".txt"
path3 = "\\server\logs\shortcuts\" & lcase(cname) & ".txt"

If (fso.FileExists(path3)) Then fso.DeleteFile(path3) end if

Set f1 = fso_OpenTextFile(path1, ForAppending, True)
Set f2 = fso_OpenTextFile(path2, ForAppending, True)

f1.writeline " was used by " & lcase(uname) & " on " & datetemp & " at " & ttemp
f2.writeline "used computer " & lcase(cname) & " on " & datetemp & " at " & ttemp

if WshSysEnv("OS")="" then
WShell.Run "%comspec% /c dir " & chr(34) & "c:\windows\start menu\*.lnk" & chr(34) & " /a-d /b /s >> " & path3 ,0,true
end if


f1.close
f2.close
wscript.echo "Logging Done" ===============
Security Forums
 
Thanx a lot for your help, for spending time and answering so quickly.
I will keep in touch

Thanx again
 
thanks once again to you two, it works fine. i'll keep in touch

five stars award for this forum is the least

bye
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top