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 > Server Operating Systems > Windows Server 2000 / 2003
Petri.co.il is happy to award Virtual 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
Logon Event ID and Report

Logon Event ID and Report

this thread has 3 replies and has been viewed 1409 times

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 18th September 2007, 00:00
jorgeandresito jorgeandresito is offline
Casual
Casual
 
 Join Date: Sep 2006
  6 month star 12 month star
 Posts: 17
 Reputation: jorgeandresito is on a distinguished road (10)
Default Logon Event ID and Report

Hi,
I need to make a report about some users and the time they logged on against a Win2003 Server.

I was using the event viewer and while trying to filter some information, i'm not quite sure what Event ID to use regarding the Logon.

Anybody knows what event id is used when a user logs in in a windows server? Any tool that can easily generate reports like these?

Thank you very much!
  #2  
Old 18th September 2007, 03:12
themanwhowouldbeking's Avatar
themanwhowouldbeking themanwhowouldbeking is offline
Casual
It's not a coincidence
 
 Join Date: Jun 2007
  6 month star 12 month star
 Location: United Kingdom
 Posts: 73
 Send a message via ICQ to themanwhowouldbeking Send a message via AIM to themanwhowouldbeking Send a message via MSN to themanwhowouldbeking Send a message via Yahoo to themanwhowouldbeking
 Reputation: themanwhowouldbeking is on a distinguished road (23)
Default Re: Logon Event ID and Report

The Event ID I believe youre looking for is 528 (successful logon) and 540 (successful network logon).

You could use a visual basic script to list all Event Codes in the Security Log, you just need to change the Event Code as appropriate. Just copy the below into a text file and save as a .vbs file extension.

Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colLoggedEvents = objWMIService.ExecQuery _
("Select * from Win32_NTLogEvent Where Logfile = 'Security' and " _
            & "EventCode = '540'")
For Each objEvent in colLoggedEvents
strTimeWritten = objEvent.TimeWritten

    dtmTimeWritten = CDate(Mid(strTimeWritten, 5, 2) & "/" & _
        Mid(strTimeWritten, 7, 2) & "/" & Left(strTimeWritten, 4) _
            & " " & Mid (strTimeWritten, 9, 2) & ":" & _
                Mid(strTimeWritten, 11, 2) & ":" & Mid(strTimeWritten, 13, 2))

    dtmDate = FormatDateTime(dtmTimeWritten, vbShortDate)
    dtmTime = FormatDateTime(dtmTimeWritten, vbLongTime)

Wscript.Echo "Username: " & objEvent.User 
WScript.Echo "Date: " & dtmDate
WScript.Echo "Time: " & dtmTime
Next
To run the file, type the following form a command prompt

Code:
cscript filename.vbs
__________________
MCSA 2000/2003
  #3  
Old 18th September 2007, 23:09
Lior_S's Avatar
MVM Lior_S Lior_S is offline
Member
MVM
 
 Join Date: Aug 2006
  6 month star 12 month star
 Location: USA
 Posts: 867
 Reputation: Lior_S has a spectacular aura aboutLior_S has a spectacular aura aboutLior_S has a spectacular aura about (247)
Default Re: Logon Event ID and Report

very nice, but you can also create a filtered view in the event viewer itself.
__________________
"...if I turn out to be particularly clear, you've probably misunderstood what I've said” - Alan Greenspan
  #4  
Old 20th September 2007, 23:21
jorgeandresito jorgeandresito is offline
Casual
Casual
 
 Join Date: Sep 2006
  6 month star 12 month star
 Posts: 17
 Reputation: jorgeandresito is on a distinguished road (10)
Thumbs up Re: Logon Event ID and Report

Yep, works great!!! Thanks a lot
Closed Thread


Go Back
Petri.co.il forums by Daniel Petri > Server Operating Systems > Windows Server 2000 / 2003


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
mail report details peter_lev SBS 2000/2003 0 8th May 2007 10:45
event ID 1016: perflib and event ID 63: Winmgmt in sbs 2003 rsin SBS 2000/2003 5 19th March 2007 20:26
Create A Report COSY General Scripting 3 31st January 2007 10:10
please help i need to get on my computer to print a report beaglelover101 Forgot Administrator Password 1 28th July 2005 09:39
Login and Logoff report asam71 General Scripting 4 30th June 2005 01:15



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

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