1.    14 Aug 2017 #1
    Join Date : Aug 2017
    Posts : 5
    Windows 10

    How can i export my Backup Event-Id's for 10 servers to 1 .txt file


    Hi all!

    First of all, i am new to scripting but i want to learn it.
    We have Server 2012R2 in our organization and Windows Server Backup is running on each server daily. I want to automatically write a .txt file every day with the backup result to a destination (C:\Logfiles). I want all servers to write in that same file so i have 1 text-file with 10 server backup results from each one.

    I know i can attach a script to an Event-ID, such as eventid:4 (backup success).

    I am working on this for 2 days now but what am i doing wrong?
    I used powershell and also cmd but can't get it working (wevtutil qe Microsoft-Windows-Backup /f:text /q:"*[System/EventID=4] and *[EventData/Data[@Name='HRESULT']='0']")

    The script is needed for failed backup results and successfull backup results. I know that the failed backup results have a lot of event id's: 5,8,9,17,22 etc.

    Can somebody help me with this?
      My ComputerSystem Spec
  2.    14 Aug 2017 #2
    Join Date : Jul 2016
    Crewe Cheshire
    Posts : 1,460
    windows 10

    Welcome to the forum. When wrting to a file you can use > to create the file ie dir >test.txt after that to write to same file you append with >> ie dir >>test.txt
      My ComputerSystem Spec
  3.    14 Aug 2017 #3
    Join Date : Aug 2017
    Posts : 5
    Windows 10
    Thread Starter

    Quote Originally Posted by Samuria View Post
    Welcome to the forum. When wrting to a file you can use > to create the file ie dir >test.txt after that to write to same file you append with >> ie dir >>test.txt
    Thanks for that! Is there somebody who can help me with the correct syntax to get the event-id result for every day's backup?
      My ComputerSystem Spec
  4.    15 Aug 2017 #4
    Join Date : Aug 2017
    Posts : 5
    Windows 10
    Thread Starter

    I now used Backup Failed and Backup Success scripts with the following content: $text = "$(Get-Date) CC-server01: Backup failed" $text >> 'C:\Log\Logging.txt'

    Also for the one that is successfull.
    I did this on 2 servers for testing and i have one script for the mailing:

    Send-MailMessage -Attachments 'C:\Log\Logging.txt' -SmtpServer "mail.example.com" -From "backup@example.com" -To "user@example.com" -Subject "Daily Report"
      My ComputerSystem Spec

 


Similar Threads
Thread Forum
Browsers & Email Import or Export Favorites as HTML File in Microsoft Edge
How to Import or Export Microsoft Edge Favorites as HTML File in Windows 10 Microsoft Edge is a new web browser that is available across the Windows 10 device family. It is designed for Windows 10 to be faster, safer, and compatible with the...
Tutorials
File System Filter 'wcifs' EVENT ID 4
Hi, When I run the error checking tool in windows for my SSD I always end up with this error in event viewer. Error checking found no problems and even system file checker didn't found any problems. I think it started after I installed Malwarebytes...
General Support
Backup Window Store game saves, app settings to export to another PC
I have install windows 10 on a previous PC, which contain some game saves. I just install Windows 10 to a new PC, and would like to import my previous game saves and app settings.. So is there anyway to backup the game saves and app settings...
Backup and Restore
no export favorites button in EDGE. How do I export my favorites?
no export favorites button in EDGE. How do I export my favorites including the favorites line in the top?
Browsers and Email
Size of backup file using Windows Backup
I have an HP a6547c desktop that has gone from Vista to Windows 8.1 and finally to Windows 10. Attached is a Western Digital 1TB external hard drive that was wiped clean. I started the Windows Backup program (worried at first when it said Backup...
Backup and Restore
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 20:58.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums