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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

record network users logon and time 2

Status
Not open for further replies.

itsteapot

Technical User
Mar 27, 2009
49
GB
Hi all, does any one have a script that I can put in users logon scripts in AD that writes to a central file recording the users logon time date name etc?
Thanks
 
set objFSO = CreateObject(Scripting.FileSystemObject")
set objFile = objFSO.OpenTextFile("c:\loginAudit.txt")
set objShell = CreateObject("WScript.Shell")

strWindowsUser = objShell.ExpandEnvironmentStrings("%UserName%")
objFile.WriteLine strWindowsUser & ": " & date & " " & time
objFile.Close

-Geates
 
Thanks, I assume i could change the c:\loginAudit.txt to a network share?
 
Thanks, I assume i could change the c:\loginAudit.txt to a network share?
 
unrelated to the script but a word of caution, previously i have had to get permission from HR and Union reps to explicitly store this type of information
 
i hope its not the one which has banned Valentines Cards! ;-)
 
No lucky not, Although I don't suppose I will get any.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top