Skip to content

Instantly share code, notes, and snippets.

@ffcommax
Created January 18, 2022 07:15
Show Gist options
  • Save ffcommax/390e5f9f411a0c2f14aa7cd810a74785 to your computer and use it in GitHub Desktop.
Save ffcommax/390e5f9f411a0c2f14aa7cd810a74785 to your computer and use it in GitHub Desktop.
user logon logs
how to get user logon logs
Get-EventLog -LogName security -InstanceId 4625 -After ((Get-Date).AddDays(-100)) | Select-Object -Property timegenerated, @{n="AccountName";e = {$.replacementstrings[5]}}, @{n="AccountDomain";e = {$.replacementstrings[6]}}, @{n="WorkstationName" ; e = {$_.replacementstrings[19]}} | export-csv c:\users\public\logs.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment