Hello,
First let me say my Posh is very rudimentary and I am fairly new.
I am trying to get all events on a list of servers and write them down on a CSV, so far I modify a bit a script I use for SQL commands from the dbatools.io module.
$outfile = 'C:\out.csv'
GET-Content C:\Servers.txt | ForEach-Object {Get-EventLog -LogName System -Newest 10 -ComputerName $_ | Where-Object {$_.EventID -eq 50, 140} |
But I am bit lost, can anyone point me what I am doing wrong.
Blog: www.sqlservertoolbox.blogspot.com.mx