Powershell Get_EventLog for multiple servers
问题 I'm a SQL DBA, n00b to Powershell, tasked with sysadmin duties at the moment I need to query error logs across my servers for Errors and Warnings. Using my own Google-fu and help from this thread I was able to get this working: $computers = Get-Content "C:\Servers\ServerList_Short.txt"; # QUERY COMPUTER SYSTEM EVENT LOG foreach($computer in $computers) { Get-EventLog -ComputerName $computer -LogName System -EntryType "Error","Warning" -After (Get-Date).Adddays(-7) ` | Select-Object -Property