Windows Eventviewer Log to Text File

This topic contains 1 reply, has 2 voices, and was last updated by  Matt Tilford 4 years, 4 months ago.

  • Author
    Posts
  • #8658

    rbala006
    Participant

    In Eventviewer -> Application and Services -> Microsoft -> Windows -> Backup -> Operational there are various events, In case Event ID 4 or 5 occurs need to send all the contents in details tab to a text file using powershell.

  • #8674

    Matt Tilford
    Participant

    The basics of the information you are after i think will be covered by

    Get-WinEvent Microsoft-Windows-Backup | where {$_.id -eq 4 -or $_.id -eq 5} | select -Property * | Out-File events.txt

    That's the very basics of the command. There are plenty of other parameters that can be set depending on what your deeper requirements are.

You must be logged in to reply to this topic.