How to read event logs of a server

I ran the following command from another machine in the same domain.

Get-EventLog -LogName “Application” -ComputerName “Server01”

I tried using the following command: But it says "Cannot open log Application on machine Server01. Windows has not provided an error code.

I want to dump entire logs under “Application” into some file.

Any suggestions please

thank you

This might help you.

I do this, see below, which works fine for me…

Get-EventLog -ComputerName "servername" -Log "Application" -After (Get-Date).AddDays(-1) -EntryType Error,Warning  |`
 Export-Excel -Path $xlsxFile -WorkSheetname "SQL Server"

Just need the ImportExcel module

Just because it annoys me everytime I see this: You don’t need a backtick after a pipe symbol to be able to use a line break. Line breaks are allowed after Pipe symbols, commata, semikola, opening parenthesis, openeing squere brackets and opening curly braces. I’m used to think that’s really enough to avoid the backticks. :wink: :smiley: