+ Post New Thread
Page 3 of 3 FirstFirst 123
Results 31 to 34 of 34
Windows Thread, Track user logons? in Technical; Wouldnt it be a little safer to map a drive, write to it then unmap it in the same script? ...
  1. #31

    CHR1S's Avatar
    Join Date
    Feb 2006
    Thank Post
    Thanked 506 Times in 309 Posts
    Rep Power

    Re: Track user logons?

    Wouldnt it be a little safer to map a drive, write to it then unmap it in the same script? Its a little time consuming but if it was hidden in the background it should be ok?

  2. #32
    projector1's Avatar
    Join Date
    Nov 2005
    Thank Post
    Thanked 1 Time in 1 Post
    Rep Power

    Re: Track user logons?

    just been reading my WindowsITPro mag for june and saw this article


    the article covers a story of a IT pro who developed a solution for his firm to see who's logged in. It also contains a nice comment from another Pro who has his own method of seeing who's logged in

  3. #33

    ZeroHour's Avatar
    Join Date
    Dec 2005
    Edinburgh, Scotland
    Thank Post
    Thanked 1,385 Times in 849 Posts
    Blog Entries
    Rep Power

    Re: Track user logons?

    Yeh but it has the same limitations as most of the other solutions, that why I made my own
    I have a few people now and we are testing it with different systems to make a guide before releasing it.
    Any ideas for names?

  4. #34
    ChrisP's Avatar
    Join Date
    Apr 2007
    Thank Post
    Thanked 8 Times in 8 Posts
    Rep Power

    Re: Track user logons?

    This is the VB script i knocked up to 'keep an eye on things'.....
    I have a few scripts that run, this one is mainly used for logging to a access database.

    Then i got a nice web front end written for it that alerts me to things such as double logons, lets me probe this database in many ways, Thats part of my asp command and control centre i knocked up (winsuite logging, dhcp probe, user (adsi) admin, proxy logging etc.)

    OK, OK - i know how messy it is. Yes i know i got Lazy on declarations (etc). However it works very well for me, maybe you can use/abuse/break it in some way.


    On Error Resume Next
    dim strKey, wshShell, intValue
    Set WshShell 			= WScript.CreateObject("WScript.Shell")
    Set FSO             		= CreateObject("Scripting.FileSystemObject")
    Set WSHNetwork          	= WScript.CreateObject("WScript.Network")
    Set objNet			=	CreateObject("wscript.Network")
    strKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Intel\Display\igfxcui\HotKeys"
    wshShell.regWrite strKey, 0, "REG_DWORD"
    strKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyOverride"
    wshShell.regWrite strKey, "gatekeeper1;*.earlham.local;<local>", "REG_SZ"
    	oUN			=	objNet.UserName
    	objHost			=	objNet.ComputerName
    	strUserName             = ""
    Set adoCon = CreateObject("ADODB.Connection")
    While strUserName       = ""
    WScript.Sleep 100
    strUserName             = WSHNetwork.UserName
    	Set OSSet = GetObject("winmgmts:").InstancesOf("Win32_OperatingSystem")
    	For each OS in OSSet
    	if Spack="" Then Spack="Data not available"
    	Set objFSO		= 	CreateObject("Scripting.FileSystemObject")
    	targetFolder		=	"c:\documents and settings\"
    	Set objFolder 		= 	objFSO.GetFolder(targetFolder)
    	Set colFiles 		= 	objFolder.subFolders
    	countFolders		=	0		
    	For Each objFile In colFiles
    	countFolders		=	countFolders + 1		
    strUserDomain           = WSHNetwork.UserDomain
    Set ObjGroupDict        = CreateMemberOfObject(strUserDomain, strUserName)
    			StartTime			=	time()
    			sDomain 			= 	"domain"
    			sGroupSelected 		= 	"Domain Users"
    			sUserSelected 		=	strUserName
    set objGroup 					= 	GetObject("WinNT://" & sDomain & "/" & sGroupSelected)
    For Each objUser in objGroup.Members
    			oNA					=	objUser.Name
    	If 	objUser.Class = "User" and oNA = sUserSelected Then
    			oFN					=	objUser.FullName		
    	oAD					=	objUser.AccountDisabled	
    			oLL					=	objUser.LastLogin		
    			oLS					=	objUser.LoginScript
    			oHD					=	objUser.HomeDirectory
    			oDS					=	objUser.Description
    	Exit For
    	End If
    adoCon.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=\\\logging$\database\logon_watch.mdb"
    Set oRS = CreateObject("ADODB.Recordset")
    strSQL = "SELECT * FROM logons;"
    oRS.CursorType = 2
    oRS.LockType = 3
    oRS.Open strSQL, adoCon
    oRS.Fields("user")  		=   oUN	
    oRS.Fields("pc")  		=   objHost					
    oRS.Fields("date")  		=   date()
    oRS.Fields("time")  		=   Time()
    oRS.Fields("domain")   		= strUserDomain           
    oRS.Fields("servicepack")	=	Spack
    oRS.Fields("profiles")		=	countFolders 
    oRS.Fields("logonscript")  	=   oLS	
    oRS.Fields("lastlogon")  	=   	oLL
    oRS.Fields("fullname")  	=   	oFN
    oRS.Fields("description")  	=   oDS
    oRS.Fields("homedirectory")  	= oHD  
    oRS.Fields("simsversion")  	= objFSO.GetFileVersion("c:\program files\sims\sims .net\pulsar.exe")
    oRS.Fields("vncversion")  	= objFSO.GetFileVersion("C:\Program Files\RealVNC\VNC4\winvnc4.exe")
    oRS.Fields("savversion")  	= objFSO.GetFileVersion("C:\Program Files\Sophos\Sophos Anti-Virus\SavMain.exe")
    ' oRS.Fields("flashversion")  	= objFSO.GetFileVersion("")
    If MemberOf(ObjGroupDict, "staff") Then 
    oRS.Fields("staff")	=	"TRUE"
    End If
    If MemberOf(ObjGroupDict, "students") Then
    oRS.Fields("student")	=	"TRUE"
    End If
    If MemberOf(ObjGroupDict, "Watch") Then
    oRS.Fields("watch")	=	"TRUE"
    End If
    Set oRS = Nothing
    Set adoCon = Nothing
    Function MemberOf(ObjDict, strKey)
    MemberOf = CBool(ObjGroupDict.Exists(strKey))
    End Function
    Function CreateMemberOfObject(strDomain, strUserName)
    Dim objUser, objGroup
    Set CreateMemberOfObject    = CreateObject("Scripting.Dictionary")
    CreateMemberOfObject.CompareMode = vbTextCompare
    Set objUser = GetObject("WinNT://" & strDomain & "/" & strUserName & ",user")
    For Each objGroup In objUser.Groups
    CreateMemberOfObject.Add objGroup.Name, "-"
    Set objUser = Nothing
    End Function

+ Post New Thread
Page 3 of 3 FirstFirst 123

Similar Threads

  1. Script to track user logins
    By Gatt in forum Scripts
    Replies: 47
    Last Post: 2nd August 2013, 11:44 AM
  2. Restricting Logons
    By Espada in forum Windows
    Replies: 2
    Last Post: 6th December 2007, 06:51 PM
  3. How do you keep track of you daily jobs?
    By Little-Miss in forum General Chat
    Replies: 28
    Last Post: 14th October 2007, 03:15 PM
  4. Slow Logons
    By andyrite in forum Windows
    Replies: 3
    Last Post: 24th April 2007, 10:48 AM
  5. Replies: 16
    Last Post: 29th March 2006, 04:52 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts