Quantcast
Channel: Configuration & Scripting
Viewing all articles
Browse latest Browse all 780

Script for backup results

$
0
0

Hi there,

I'm new to scripting and want to learn it. I have an environment with 12 servers that make a backup every day with Microsoft Windows Backup. I want to have one text file with all the results of the servers that i can email to myself.

I made a simple script for the event ID output, i made a task that triggers on a fail or succesfull backup event id (4): 

$text = "$(Get-Date) CC-server1: Backup completed successfully"
$text >> 'C:\Log\Logging.txt'

I did this for the failed task too. Also the other servers have the same script so all the results come in the same logging.txt

Then i made a script that mails the txt file to myself, that's not the problem.
The problem is i want the failed backup script to give a error message in the logging.txt and not only : backup failed.
How can i do that?


Viewing all articles
Browse latest Browse all 780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>