Set-VBOEmailSettings

Short Description

Modifies email notification settings. Email notifications are sent from a backup proxy server upon each execution of a backup or backup copy job.

Syntax

This cmdlet provides parameter sets that allow you to:

  • Modify email notification settings to use a custom SMTP server with basic authentication.

Set-VBOEmailSettings [-EnableNotification <SwitchParameter>] [-SMTPServer <String>] [-Port <Int32>] [-UseAuthentication <SwitchParameter>] [-UseSSL <SwitchParameter>] [-Credential <PSCredential>] [-From <String>] [-To <String>] [-Subject <String>] [-NotifyOnSuccess <SwitchParameter>] [-NotifyOnWarning <SwitchParameter>] [-NotifyOnFailure <SwitchParameter>] [-SupressUntilLastRetry <SwitchParameter>] [-AttachDetailedReport <SwitchParameter>] [<CommonParameters>]

  • Modify email notification settings to use a Google account for authentication.

Set-VBOEmailSettings -GoogleGmail <SwitchParameter> [-EnableNotification <SwitchParameter>] [-ClientId <String>] [-ClientSecret <SecureString>] [-From <String>] [-To <String>] [-Subject <String>] [-NotifyOnSuccess <SwitchParameter>] [-NotifyOnWarning <SwitchParameter>] [-NotifyOnFailure <SwitchParameter>] [-SupressUntilLastRetry <SwitchParameter>] [-AttachDetailedReport <SwitchParameter>] [<CommonParameters>]

  • Modify email notification settings to use a Microsoft 365 account for authentication.

Set-VBOEmailSettings -Microsoft365 <SwitchParameter> [-EnableNotification <SwitchParameter>] [-ClientId <String>] [-MailApiUrl <String>] [-TenantId <String>] [-From <String>] [-To <String>] [-Subject <String>] [-NotifyOnSuccess <SwitchParameter>] [-NotifyOnWarning <SwitchParameter>] [-NotifyOnFailure <SwitchParameter>] [-SupressUntilLastRetry <SwitchParameter>] [-AttachDetailedReport <SwitchParameter>] [<CommonParameters>]

Detailed Description

This cmdlet modifies email notification settings for Veeam Backup for Microsoft 365. To modify settings, you need to enter the necessary parameters with new values. The parameters that you omit will remain unchanged.

Set-VBOEmailSettings Note

Email notification settings are global, they will be applied to all backup and backup copy jobs configured in Veeam Backup for Microsoft 365.

Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Accept Wildcard Characters

EnableNotification

Defines that Veeam Backup for Microsoft 365 will send email notifications.

SwitchParameter

False

Named

False

False

SMTPServer

Specifies the full DNS name or IP address of the SMTP server for sending email notifications.

String

False

Named

False

False

Port

Specifies a port number for connecting to SMTP server.

Int32

False

Named

False

False

UseAuthentication

Defines that the SMTP server requires authentication. Otherwise, the connection will be established to the SMTP server, which does not enforce authentication.

SwitchParameter

False

Named

False

False

UseSSL

Defines that Veeam Backup for Microsoft 365 will enable a secure connection for email notification transmission. Otherwise, email notifications will be transmitted through the connection that does not require SSL authentication.

SwitchParameter

False

Named

False

False

Credential

Specifies credentials that you want to use for authentication to the SMTP server.

PSCredential

False

Named

False

False

From

Specifies email address of the notification sender.

String

False

Named

False

False

To

Specifies email address of the notification recipient. Semicolon is used for listing multiple recipients.

String

False

Named

False

False

Subject

Specifies the subject for email notifications. You can use the following system variables:

  • %JobName% - name of a backup or backup copy job.
  • %JobResult% - a job result.
  • %OrgName% - organization whose data was processed by a backup or backup copy job.
  • %MailboxCount% - total number of processed objects.
  • %Issues% - number of objects that were processed with the Failed or Warning status.
  • %Time% - date and time of a job completion.

String

False

Named

False

False

NotifyOnSuccess

Defines that Veeam Backup for Microsoft 365 will send email notifications if a backup or backup copy job completes successfully without any warnings or errors.

SwitchParameter

False

Named

False

False

NotifyOnWarning

Defines that Veeam Backup for Microsoft 365 will send email notifications if a backup or backup copy job completes with warnings.

SwitchParameter

False

Named

False

False

NotifyOnFailure

Defines that Veeam Backup for Microsoft 365 will send email notifications if a backup or backup copy completes with errors.

SwitchParameter

False

Named

False

False

SupressUntilLastRetry

Defines that Veeam Backup for Microsoft 365 will send email notifications according to the job schedule settings. The following email notification scenarios are possible:

  • If the job fails, Veeam Backup for Microsoft 365 will send a notification message on the last job retry.
  • If the job completes with Success or Warning, Veeam Backup for Microsoft 365 will send a notification message on the last completion status.
  • If the job is scheduled to Terminate job if it exceeds allowed backup window, Veeam Backup for Microsoft 365 will send a notification message on the last attempt within the configured interval.

For more information on job schedule settings, see the New-VBOJobSchedulePolicy and New-VBOCopyJobSchedulePolicy cmdlets.

SwitchParameter

False

Named

False

False

AttachDetailedReport

Defines that a detailed report about the job results will be included as an email attachment.

SwitchParameter

False

Named

False

False

GoogleGmail

Defines that Veeam Backup for Microsoft 365 will send email notifications on behalf of a Google account.

SwitchParameter

True

Named

False

False

ClientId

Specifies the client ID obtained while registering an application in the Google Cloud console or Microsoft Azure portal.

String

False

Named

False

False

ClientSecret

Specifies a password.

Note: This parameter is required only for authentication with a Google account using a custom application.

SecureString

False

Named

False

False

Microsoft365

Defines that Veeam Backup for Microsoft 365 will send email notifications on behalf of a Microsoft 365 account.

SwitchParameter

True

Named

False

False

MailApiUrl

Specifies the Microsoft Graph endpoint for sending mail.

Note: The default value is https://graph.microsoft.com/v1.0.

String

False

Named

False

False

TenantId

Specifies a tenant ID in Azure Active Directory.

String

False

Named

False

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.

Examples

Set-VBOEmailSettingsExample 1. Modifying Email Notification Settings for SMTP Server with Basic Authentication

This command configures email notifications with the following settings:

  • Email notifications will be sent through the default SMTP server with basic authentication.
  • Email notifications will be sent to several recipients if the job completes with error.
  • The body of the subject in email notifications will contain system variables.

Set-VBOEmailSettings -EnableNotification -From vbo@tech.com -To "helpdesk@tech.com; support@tech.com" -Subject "[%JobResult%] %Time% %OrgName% - %JobName% (%MailboxCount% objects), %Issues% issues" -NotifyOnFailure

Run the Set-VBOEmailSettings cmdlet and specify the following settings:

  • Provide the EnableNotification parameter.
  • Specify values for the From, To and Subject parameters.
  • Provide the NotifyOnFailure parameter.

Set-VBOEmailSettingsExample 2. Modifying Email Notification Settings for Authentication with Microsoft 365 Account Using Veeam Application

This command configures email notifications with the following settings:

  • Email notifications will be sent on behalf of the Microsoft 365 account.
  • Authentication to Microsoft authentication portal will be performed using an application preinstalled by Veeam.
  • Email notifications will be sent to several recipients if the job completes without any warnings or errors.
  • The body of the subject in email notifications will contain system variables.

Set-VBOEmailSettings -EnableNotification -To "helpdesk@tech.com; support@tech.com" -Subject "[%JobResult%] %Time% %OrgName% - %JobName% (%MailboxCount% objects), %Issues% issues" -NotifyOnSuccess -Microsoft365

Run the Set-VBOEmailSettings cmdlet and specify the following settings:

  • Provide the EnableNotification parameter.
  • Specify values for the To and Subject parameters.
  • Provide the Microsoft365 parameter.
  • Provide the NotifyOnSuccess parameter.

Set-VBOEmailSettingsExample 3. Modifying Email Notification Settings for Authentication with Google Account Using Veeam Application

This command configures email notifications with the following settings:

  • Email notifications will be sent on behalf of the Google account.
  • Authentication to Google will be performed using an application preinstalled by Veeam.
  • Email notifications will be sent to several recipients if the job completes without any warnings or errors.
  • The body of the subject in email notifications will contain system variables.

Set-VBOEmailSettings -EnableNotification -To "helpdesk@tech.com; support@tech.com" -Subject "[%JobResult%] %Time% %OrgName% - %JobName% (%MailboxCount% objects), %Issues% issues" -NotifyOnSuccess -GoogleGmail

Run the Set-VBOEmailSettings cmdlet and specify the following settings:

  • Provide the EnableNotification parameter.
  • Specify values for the To and Subject parameters.
  • Provide the GoogleGmail parameter.
  • Provide the NotifyOnSuccess parameter.

Set-VBOEmailSettingsExample 4. Modifying Email Notification Settings for Authentication with Microsoft 365 Account Using Custom Application

This command configures email notifications with the following settings:

  • Email notifications will be sent on behalf of the Microsoft 365 account.
  • Authentication to Microsoft authentication portal will be performed using a custom application registered in Microsoft Azure portal.
  • Email notifications will be sent to several recipients if the job completes without any warnings or errors.
  • The body of the subject in email notifications will contain system variables.

Set-VBOEmailSettings -EnableNotification -To "helpdesk@tech.com; support@tech.com" -Subject "[%JobResult%] %Time% %OrgName% - %JobName% (%MailboxCount% objects), %Issues% issues" -NotifyOnSuccess -Microsoft365 -ClientId bd0xxxxx-2d90-0000-86f5-5488df12xxxx -TenantId xxxxde96-x000-4a97-8ae0-ba91c4aaxxxx

Run the Set-VBOEmailSettings cmdlet and specify the following settings:

  • Provide the EnableNotification parameter.
  • Specify values for the To and Subject parameters.
  • Provide the Microsoft365 parameter.
  • Provide the NotifyOnSuccess parameter.
  • Specify values for the ClientId and TenantId parameters.

Set-VBOEmailSettingsExample 5. Modifying Email Notification Settings for Authentication with Google Account Using Custom Application

This example shows how to configure email notifications with the following settings:

  • Email notifications will be sent on behalf of the Google account.
  • Authentication to Google will be performed using a custom application registered in the Google Cloud console.
  • Email notifications will be sent to several recipients if the job completes without any warnings or errors.
  • The body of the subject in email notifications will contain system variables.

$clientsecret = "XXXXXX-xxxxXXxxxXXXXXXXXXXXxxxxxxxx"

$securepassword = $clientsecret | ConvertTo-SecureString -AsPlainText -Force

Set-VBOEmailSettings -EnableNotification -To "helpdesk@tech.com; support@tech.com" -Subject "[%JobResult%] %Time% %OrgName% - %JobName% (%MailboxCount% objects), %Issues% issues" -NotifyOnSuccess -GoogleGmail -ClientId 012345678901-xxxxxxxxxxxxxxxxxxxxxxxxxxxxkdgp.apps.googleusercontent.com -ClientSecret $securepassword

Perform the following steps:

  1. Assign a client secret of your custom application to the $clientsecret variable.
  2. Run the ConvertTo-SecureString cmdlet with the $clientsecret variable to turn the password into the SecureString type. Save the result to the $securepassword variable.
  3. Run the Set-VBOEmailSettings cmdlet. Specify the following settings:
  • Provide the EnableNotification parameter.
  • Specify values for the To and Subject parameters.
  • Provide the GoogleGmail parameter.
  • Specify the ClientId parameter value.
  • Set the $securepassword variable as the ClientSecret parameter value.
  • Provide the NotifyOnSuccess parameter.

Related Commands

ConvertTo-SecureString