Petri.co.il forums by Daniel Petri  

Petri.co.il forums Home Forums Start Page Forums Frequently Asked Questions FAQ Member List Members List
Go Back   Petri.co.il forums by Daniel Petri > Operating Systems > Scripting
Petri.co.il is happy to award Cruachan the title of Most Valuable Member !!!
Register Calendar Calendar Search Petri.co.il forums by Daniel Petri Search Today's Posts Mark Forums Read

Notices

IDEALSTOR
Login and Logoff report

Login and Logoff report

this thread has 4 replies and has been viewed 4942 times

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 30th June 2005, 01:08
asam71 asam71 is offline
Casual
Casual
 
 Join Date: Apr 2004
  6 month star 12 month star
 Location: Rockville, MD
 Posts: 6
 Reputation: asam71 is on a distinguished road (10)
Default Login and Logoff report

I've been asked by my director to come up with a way to run a report for login and logoff times for our users.

Does anyone know of any tools for this? I'm sure the info would need to come from the security logs on the domain controllers. I have 3 domain controllers for our domain and I don't want to look at each individually to find this info.

Does anyone have any ideas?
  #2  
Old 30th June 2005, 01:15
stoo.mp stoo.mp is offline
Casual
It's not a coincidence
 
 Join Date: Jun 2005
  6 month star 12 month star
 Location: Wiltshire, UK
 Posts: 71
 Reputation: stoo.mp is on a distinguished road (10)
Default RE: Login and Logoff report

I wrote a little script to do the same thing... also gives IP address, Machine Name, User Name, Date, Time..

It uses KIX... are you familiar with it? (it's a VERY simple script program)

Will post the script in a sec...

KIX: http://www.kixtart.org/
__________________
1 + 1 = 11 ... honest!
  #3  
Old 30th June 2005, 01:32
stoo.mp stoo.mp is offline
Casual
It's not a coincidence
 
 Join Date: Jun 2005
  6 month star 12 month star
 Location: Wiltshire, UK
 Posts: 71
 Reputation: stoo.mp is on a distinguished road (10)
Default RE: Login and Logoff report

KIX script for logging a users login:

Firstly, get Kixtart from the URL above.

Save the required files to the NETLOGON folder on your DC (see the quick-start guide for KIX).

Create a .BAT file which will call the LOGIN portition.

In the .BAT file put:

Code:
@echo off
\\SERVER_NAME\netlogon\kix32 \\SERVER_NAME\netlogon\log_login.kix
Save the file as LOG_LOGIN.BAT (or something)

Create a new txt file, rename it LOG_LOGIN.KIX and open in notepad. Enter this:

Code:
IF Open( 3 , "\\**PATH_TO_SAVE_TO**\LOG.TXT" , 5 ) = 0
  $x = WriteLine( 3 , "Logged In:," + @MDayNo + "/" + @Month + "/" + @Year + "  " + @TIME + "," + @UserID + "," + @WkSta + "," + @IPADDRESS0 + @CRLF )
ELSE
  BEEP
  ? "failed to open file, error code : [" + @ERROR + "]"
ENDIF
Save this as the same name in LOG_LOGIN.BAT (eg: LOG_LOGIN.KIX)

Next create a .BAT file for the log out and enter:

Code:
@echo off
\\SERVER_NAME\netlogon\kix32 \\SERVER_NAME\netlogon\log_logout.kix
Create another txt file for logging a users logout rename it LOG_LOGOUT.KIX :

Code:
IF Open( 3 , "\\**PATH_TO_SAVE_TO**\LOG.TXT" , 5 ) = 0
  $x = WriteLine( 3 , "Logged Out:," + @MDayNo + "/" + @Month + "/" + @Year + "  " + @TIME + "," + @UserID + "," + @WkSta + "," + @IPADDRESS0 + @CRLF )
ELSE
  BEEP
  ? "failed to open file, error code : [" + @ERROR + "]"
ENDIF
(Both scripts write the same LOG.TXT and is comma-delimited for easy import in to Excel and filtering a users activity)

Now, add the call to each .BAT file in AD via GPO's.... shout if you need help with adding login/logout GPO configurations.

Stoo

(adapt any paths/filenames to suit your network and needs)
__________________
1 + 1 = 11 ... honest!
  #4  
Old 30th June 2005, 01:41
stoo.mp stoo.mp is offline
Casual
It's not a coincidence
 
 Join Date: Jun 2005
  6 month star 12 month star
 Location: Wiltshire, UK
 Posts: 71
 Reputation: stoo.mp is on a distinguished road (10)
Default RE: Login and Logoff report

Here's an example output (ignore the names :P )

Code:
Logged In:,23/June/2005  09:29:28,WHSGB,CDSERVER02,169.254.254.250
Logged In:,23/June/2005  09:45:29,bickersn,CDSERVER02,169.254.254.250
Logged In:,23/June/2005  09:50:38,jenningsa,CDSERVER02,169.254.254.250
Logged Out:,23/June/2005  17:26:36,townsendb,ELITE12,169.254.254. 54
Logged Out:,23/June/2005  17:27:16,evenettg,GELAPTOP,169.254.254. 25
Logged Out:,23/June/2005  17:29:03,jonesc,INDUSTRIAL4,169.254.254. 33
__________________
1 + 1 = 11 ... honest!
  #5  
Old 30th June 2005, 02:15
windux windux is offline
Member
Here to help
 
 Join Date: Jun 2005
  6 month star 12 month star
 Location: Here
 Posts: 348
  Send a message via MSN to windux
 Reputation: windux is on a distinguished road (10)
Default RE: Login and Logoff report

If you want some comercial software you can see here one example:

http://www.isdecisions.com/index.cfm...s-WinReporter#

Another way to do this, audit you login/logon in windows and then extract from event log to one file or data base with scripting.
__________________
MCSE w2k
MCSA w2k - MCSA w2k MESSAGING
MCDBA SQL2k
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shutdown Login Script Michael19ave Forgot Administrator Password 1 24th February 2006 00:12
Deny Login after certain time of day dfcrj Active Directory 7 17th June 2005 03:36
Force a logoff or a restart after a set period of idle... Goober Windows 2000 Pro, XP Pro 5 7th January 2005 00:22



All times are GMT +3. The time now is 21:21.

Steel Blue Style vBulletin Style ©2006 vBEnhanced Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
 

Valid XHTML 1.0!   Valid CSS!

Copyright 2005 Daniel Petri