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.

https://social.technet.microsoft.com/Forums/en-US/e9ec27ac-367b-41b4-b298-1cf6de989a56/how-to-read-event-logs-of-a-windows-2012-server?forum=winserverpowershell#95a2ff99-9c28-4bc2-812c-891e07abd430

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: