Question

Backup Eamil Notifications


Userlevel 1

Is that any way to trigger notification when backup job start?


6 comments

Userlevel 7
Badge +20

Typically it is for job completion but maybe VONE can do that.  Will need to check.

Userlevel 6
Badge +2

What about setting the PowerShell script to send email like this:

 

 

This is the PowerSHell script content which can be customized for your use:

# In the next line, paste the results from this command: Read-Host -Prompt 'Password' -AsSecureString | ConvertFrom-SecureString | Set-Clipboard
$EncryptedCredential = "<See comment above>"
$EmailUsername = "email1@email.com"
$EncryptedPW = $EncryptedCredential | ConvertTo-SecureString
$Credential = New-Object System.Management.Automation.PsCredential($EmailUsername, $EncryptedPW)
$EmailFrom = "email1@email.com"
$EmailTo = "email2@email.com"
$SMTPServer = "smtp.office365.com"
$SMTPPort = 587
$subject = "Subject email goes here"
$MessageBody = "Email body goes here"

$SMTPSsl = $true

$param = @{
    SmtpServer = $SMTPServer
    Port       = $SMTPPort
    UseSsl     = $SMTPSsl
    Credential = $Credential
    From       = $EmailFrom
    To         = $EmailTo
    Subject    = $subject
    Body       = $MessageBody
}

Send-MailMessage @param

Hope that helps.

Userlevel 7
Badge +20

What about setting the PowerShell script to send email like this:

 

 

This is the PowerSHell script content which can be customized for your use:

# In the next line, paste the results from this command: Read-Host -Prompt 'Password' -AsSecureString | ConvertFrom-SecureString | Set-Clipboard
$EncryptedCredential = "<See comment above>"
$EmailUsername = "email1@email.com"
$EncryptedPW = $EncryptedCredential | ConvertTo-SecureString
$Credential = New-Object System.Management.Automation.PsCredential($EmailUsername, $EncryptedPW)
$EmailFrom = "email1@email.com"
$EmailTo = "email2@email.com"
$SMTPServer = "smtp.office365.com"
$SMTPPort = 587
$subject = "Subject email goes here"
$MessageBody = "Email body goes here"

$SMTPSsl = $true

$param = @{
    SmtpServer = $SMTPServer
    Port       = $SMTPPort
    UseSsl     = $SMTPSsl
    Credential = $Credential
    From       = $EmailFrom
    To         = $EmailTo
    Subject    = $subject
    Body       = $MessageBody
}

Send-MailMessage @param

Hope that helps.

Actually forgot about this. Good suggestion 👍

Userlevel 6
Badge +2

No worries @Chris.Childerhose glad that I can share something useful to the community here 😃

Userlevel 7
Badge +9

What about setting the PowerShell script to send email like this:

 

 

This is the PowerSHell script content which can be customized for your use:

# In the next line, paste the results from this command: Read-Host -Prompt 'Password' -AsSecureString | ConvertFrom-SecureString | Set-Clipboard
$EncryptedCredential = "<See comment above>"
$EmailUsername = "email1@email.com"
$EncryptedPW = $EncryptedCredential | ConvertTo-SecureString
$Credential = New-Object System.Management.Automation.PsCredential($EmailUsername, $EncryptedPW)
$EmailFrom = "email1@email.com"
$EmailTo = "email2@email.com"
$SMTPServer = "smtp.office365.com"
$SMTPPort = 587
$subject = "Subject email goes here"
$MessageBody = "Email body goes here"

$SMTPSsl = $true

$param = @{
    SmtpServer = $SMTPServer
    Port       = $SMTPPort
    UseSsl     = $SMTPSsl
    Credential = $Credential
    From       = $EmailFrom
    To         = $EmailTo
    Subject    = $subject
    Body       = $MessageBody
}

Send-MailMessage @param

Hope that helps.

Great suggestion!

Userlevel 5
Badge +3

Just to add, pre-job script is definitely the way to go. You can pull information on the job invoking the script with:

 

$ScriptPID = Get-WMIObject win32_process | Where-Object {$_.ProcessID -eq $PID}
$ParentProc = Get-WMIObject win32_process | Where-Object {$_.ProcessID -eq $ScriptPID.ParentProcessId}
$JobID = $ParentProc.CommandLine.Split()[7].Trim('"')
$Job = Get-VBRJob | Where-Object {$_.id -eq $JobID}

Then in PS just pass relevant properties from $Job to your script to send information on it.

Comment