How to read event logs of a server

This topic contains 3 replies, has 3 voices, and was last updated by  Olaf Soyk 3 weeks, 6 days ago.

  • Author
    Posts
  • #102958

    jason smith
    Participant

    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

  • #102967

    Olaf Soyk
    Participant
  • #102994

    iain Barnetson
    Participant

    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

    • #102997

      Olaf Soyk
      Participant

      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. 😉 😀

You must be logged in to reply to this topic.