How to read event logs of a server

Welcome Forums General PowerShell Q&A How to read event logs of a server

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
11 months ago.

  • Author
    Posts
  • #102958

    Participant
    Topics: 8
    Replies: 7
    Points: 0
    Rank: Member

    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

    Participant
    Topics: 1
    Replies: 1330
    Points: 1,674
    Helping Hand
    Rank: Community Hero
  • #102994

    Participant
    Topics: 33
    Replies: 128
    Points: 305
    Helping Hand
    Rank: Contributor

    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

      Participant
      Topics: 1
      Replies: 1330
      Points: 1,674
      Helping Hand
      Rank: Community Hero

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

The topic ‘How to read event logs of a server’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort