Take the following script and modify as follows:
Will output the following info (only) in csv format:
Date: Take the [login to view URL] field and convert to a more standard format: 9/29/13 5:34 pm
EventID: [login to view URL]
User: within [login to view URL] is a field "Account Name:" - grab the result of that
existing script------------------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colLoggedEvents = [login to view URL] _
("Select * from Win32_NTLogEvent " _
& "Where Logfile = 'Security'" & " AND EventCode = '4624'" & " AND Message LIKE '%mjackson%'")
For Each objEvent in colLoggedEvents
[login to view URL] "Category: " & [login to view URL] & VBNewLine _
& "Computer Name: " & [login to view URL] & VBNewLine _
& "Event Code: " & [login to view URL] & VBNewLine _
& "Message: " & [login to view URL] & VBNewLine _
& "Record Number: " & [login to view URL] & VBNewLine _
& "Source Name: " & [login to view URL] & VBNewLine _
& "Time Written: " & [login to view URL] & VBNewLine _
& "Event Type: " & [login to view URL] & VBNewLine _
& "User: " & [login to view URL]
Next
-----------------
existing output sample
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Category: 12544
Computer Name: [login to view URL]
Event Code: 4624
Message: An account was successfully logged on.
Subject:
Security ID: S-1-5-18
Account Name: DG03$
Account Domain: DG
Logon ID: 0x3e7
Logon Type: 10
New Logon:
Security ID: S-1-5-21-3202901910-2567428617-1431904256-1226
Account Name: mjackson
Account Domain: DG
Logon ID: 0x69f62a3c
Logon GUID: {F43FC305-2474-9FBF-7EF4-86223B882783}
Process Information:
Process ID: 0x1c2c
Process Name: C:\Windows\System32\[login to view URL]
Network Information:
Workstation Name: DG03
Source Network Address: [login to view URL]
Source Port: 51481
Detailed Authentication Information:
Logon Process: User32
Authentication Package: Negotiate
Transited Services: -
Package Name (NTLM only): -
Key Length: 0
This event is generated when a logon session is created. It is generated on the computer that was accessed.
The subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as [login to view URL] or Services.exe.
The logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network).
The New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on.
The network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.
The authentication information fields provide detailed information about this specific logon request.
- Logon GUID is a unique identifier that can be used to correlate this event with a KDC event.
- Transited services indicate which intermediate services have participated in this logon request.
- Package name indicates which sub-protocol was used among the NTLM protocols.
- Key length indicates the length of the generated session key. This will be 0 if no session key was requested.
Record Number: 2697013
Source Name: Microsoft-Windows-Security-Auditing
Time Written: 20130929211310.595451-000
Event Type: Audit Success
User: