# Get today's date for the report
$today = Get-Date
# Setup email parameters
$subject = "Replication REPORT - " + $today
$priority = "Normal"
$smtpServer = "SMTP.Server.com"
$emailFrom = "from@email.com"
$emailTo = "to@email.com"
$log = "C:\temp\ReplicationSummary.txt"
repadmin /replsum * /bysrc /bydest /sort:delta > $log
#$ReplicationStatus = "Replication REPORT - " + $today
$Result = Get-Content C:\temp\ReplicationSummary.txt -raw
# Send the report email
Send-MailMessage -To $emailTo -Subject $subject -Body $Result -SmtpServer $smtpServer -From $emailFrom -Priority $priority
No comments:
Post a Comment