For this you can use the CmdLet Get-EventLog
PowerShell to read eventviewer security log
Saran
26
Reputation points
Hi All,
Would like to get - "Event ID, Computer Name, Account Name, Source Network Address, Logged" from PowerShell. Since I see lot of login attack to our server.
Any anyone help to share some code to export as csv
Windows for business | Windows Server | User experience | PowerShell
2 answers
Sort by: Most helpful
-
-
Saran 26 Reputation points
2022-12-01T12:44:26.627+00:00 I have tried simple one but did not get login Account name
get-eventlog security | where-object {$_.EventID -eq "4625"} | select TimeGenerated,UserName |fl