Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

PowerShell Script to fetch Logon/Logoff user on particular server {Get-WinEvent} {Get-EventLog}

$
0
0

Hello,

I'm looking for a script which can fetch for me a username that he/she loges in on all the servers.

I have tried several scripts, but it doesn't fetch the information i'm looking for.

Get-EventLog Security -ComputerName Computer  -Source Microsoft-Windows-Security-Auditing | Where {$_.InstanceID -like "4624"} | Select $UserProperty | where {$_.Username -Like "username"} | Export-Csv D:\Logon.csv -NoTypeInformation

Or to loop through a file contains the server names and fetch the required details based on the username.

Any help




Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>