PoshCode Archive  Check-in [ff08a64909]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Powershell script to verify if Windows Backup has finished sucessfully or not. On error or warning it sends an email with the server name and the error/warning. On success it does nothing (means the backup finished successfully)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:ff08a64909c6b958b7894206d6a6c456307af69373cc09178204c1839bd114c0
User & Date: Paulo Seabra 2018-06-10 14:17:11
Context
2018-06-10
14:17
This script enables you too search AD for SMTP addresses that are possibly in use, using the QUEST PowerShell PSSnapIn and searching the “proxyAddress” attribute of objects. The output details either that the SMTP address is not found in AD or you get details of the object that owns the SMTP address. check-in: abb7d602d9 user: Paul Brice tags: trunk
14:17
Powershell script to verify if Windows Backup has finished sucessfully or not. On error or warning it sends an email with the server name and the error/warning. On success it does nothing (means the backup finished successfully) check-in: ff08a64909 user: Paulo Seabra tags: trunk
14:17
get utilization from all network interfaces check-in: 09964e93f7 user: Joel Bennett tags: trunk
Changes

Added Windows-Backup-Check.ps1.







































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# encoding: ascii
# api: powershell
# title: Windows Backup Check
# description: Powershell script to verify if Windows Backup has finished sucessfully or not. On error or warning it sends an email with the server name and the error/warning. On success it does nothing (means the backup finished successfully)
# version: 0.1
# type: script
# author: Paulo Seabra
# license: CC0
# x-poshcode-id: 6519
# x-archived: 2016-10-31T13:09:14
# x-published: 2016-09-14T16:43:00
#
#
#Powershell Script Made by Paulo Seabra. Use it freely, but please give proper credits.

# Set Session variables
$Computer=hostname
$Events=Get-EventLog -LogName Application -EntryType Warning,Error -Source Microsoft-Windows-Backup -After (Get-Date).AddHours(-24)

# Set email parameters
$PSEmailServer = "fqdn of email server"
$EmailFrom="youremail@yourdomain.xx"
$EmailTo="youremail@yourdomain.xx"
$EmailSubject="Backup - $Computer"


# Build body Error/Warning Messages
$EmailBody="<html><head><meta http-equiv=`"Content-Type`" content=`"text/html; charset=utf-8`"></head>"+ $Computer + "<br><br>"
If (!$Events) {exit}
foreach ($Event in $Events){
if ($Events)
{    $Emailbody = $Emailbody + $Event.message + "<br>" +"<br>"}
}

Send-MailMessage -From $EmailFrom -To $EmailTo -Subject $EmailSubject -Body $EmailBody -BodyAsHtml -Encoding ([System.Text.Encoding]::UTF8)