Splunk Search

Need last logon for a user

chrodriguez
Engager

Need to know what was the last time a domain AD account “username” was logged into and from what server/machine please?

Labels (1)
Tags (1)
0 Karma
1 Solution

nwuest
Path Finder

Hi @chrodriguez,

So you are specifically looking for the account "wmsadmin", which is disabled to see the last time that it was used to log in?

Have you been collecting logs in your environment with splunk forwarders since "9/20/2011" the date of the lastLogonTimestamp?

  • If you have had splunk forwarders collecting events for that long, what is your retention policy with frozen buckets?
  • If not, you can try to kickoff an event with 'enabling that account, logging in-and-out with it then disabling the account'.
    Then you should see some activity in your searchhead so that search will return some results.

Let us know what happens!

V/R,
nwuest

 

View solution in original post

0 Karma

nwuest
Path Finder

Hi @chrodriguez,

So you are specifically looking for the account "wmsadmin", which is disabled to see the last time that it was used to log in?

Have you been collecting logs in your environment with splunk forwarders since "9/20/2011" the date of the lastLogonTimestamp?

  • If you have had splunk forwarders collecting events for that long, what is your retention policy with frozen buckets?
  • If not, you can try to kickoff an event with 'enabling that account, logging in-and-out with it then disabling the account'.
    Then you should see some activity in your searchhead so that search will return some results.

Let us know what happens!

V/R,
nwuest

 

0 Karma

chrodriguez
Engager

thanks for the insight, I completely forgot that we have only had splunk introduced since 2016. So thats why its not populating data from 2011.

 

 

0 Karma

chrodriguez
Engager

That doesn't return anything, I really need to focus on "A User" not just everything. I ran this, and it returned nothing for the account but then when I try against my user account it does return data. The account wmsadmin is indeed an actual user account that is disabled and the "lastLogonTimestamp" has a value or date of 9/20/2011.

index=wineventlog sourcetype=WinEventLog:Security (EventCode=4624 OR EventCode=4634 "wmsadmin")
| eval day=strftime(_time,"%d/%m/%Y")
| stats earliest(_time) AS earliest latest(_time) AS latest by user host day
| eval earliest=strftime(earliest,"%d/%m/%Y %H.%M.%S"), latest=strftime(latest,"%d/%m/%Y %H.%M.%S")

0 Karma

nwuest
Path Finder

Hi @chrodriguez 

Try this:

EventCode=4624 | dedup ComputerName | table ComputerName _time

View solution in original post 

Let us know if this works for you

V/R,
nwuest

0 Karma

chrodriguez
Engager

That doesn't return anything, I really need to focus on "A User" not just everything. I ran this, and it returned nothing for the account but then when I try against my user account it does return data. The account wmsadmin is indeed an actual user account that is disabled and the "lastLogonTimestamp" has a value or date of 9/20/2011. index=wineventlog sourcetype=WinEventLog:Security (EventCode=4624 OR EventCode=4634 "wmsadmin") | eval day=strftime(_time,"%d/%m/%Y") | stats earliest(_time) AS earliest latest(_time) AS latest by user host day | eval earliest=strftime(earliest,"%d/%m/%Y %H.%M.%S"), latest=strftime(latest,"%d/%m/%Y %H.%M.%S")

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...