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