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!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...