Veeam Backup for Microsoft Office 365 v5: adding Auxiliary Backup Accounts via PowerShell

Veeam Backup for Microsoft Office 365 v5: adding Auxiliary Backup Accounts via PowerShell

A little over a year ago, I wrote a blog post on how to add auxiliary backup accounts using PowerShell for Veeam Backup for Microsoft Office 365 v4.

This script was quickly put together and at that point in time, it did its job. With the release of v5, I recently received questions if it would still work and it somewhat does, however, I decided to upgrade it for several reasons but the main reason is support for MFA-enabled accounts.

It will now show you a web login form compared to the native Windows login screen which allows you to benefit from the latest and greatest MFA-enabled account option.

I’ve published the new version on GitHub along the old version:

What’s new?

As mentioned in the intro, it will now allow you to log in against Microsoft 365 using an MFA-enabled account. In order to do this, I’ve switched from the old (legacy) MSOnline module to AzureAD module.

Additional changes include:

  • Output log now has timestamps so you know how long certain things take
  • An additional check is added to assure the security group exists or not (which was a great suggestion from several users who ran into issues before with this)
  • Removed or replaced (soon to be) deprecated cmdlets

The logic for using the script is still the same and it will perform the following steps:

  • Create a security group if needed
  • Add accounts to your Microsoft 365 subscription (with a random password)
  • Add these accounts to the security group
  • Configure accounts as backup accounts within Veeam Backup for Microsoft Office 365

There are a few parameters that can be changed.

# Modify the values below to your needs
# Number of accounts to add - advised is to add in bulk of 8 accounts
[Int]$Accounts = 8

# Number to start from (change this if you are adding extra accounts)
[Int]$StartFrom = 1

# Display Name for the accounts (these will get a number at the end, eg VeeamBackupAccount1, VeeamBackupAccount2)
$DisplayName = "VeeamBackupAccount"

# Your domain name
$Domain = "yourdomain(.onmicrosoft).com"

# Your security group name
$SecurityGroup = "VBO"

# Organization name as configured in Veeam Backup for Microsoft Office 365
$OrganizationName = "yourdomain(.onmicrosoft).com"

Once you execute this it will configure everything for you within Microsoft 365 as you can see from the example below.

And finally, it will apply everything to Veeam Backup for Microsoft 365.

Any feedback is appreciated or if you adjust the script, feel free to ask for a pull request on GitHub.

I’m also working on a script to quickly add multiple backup applications in case you already use MFA for your organization. Stay tuned!

Niels Engelen on GithubNiels Engelen on Twitter
Niels Engelen
Working as a Principal Analyst in Product Management for Veeam Software with an interest in anything virtual and cloud with a strong focus on AWS, Azure and Microsoft 365. He is also a VMware Certified Professional, a Veeam Certified Architect and gained the VMware vExpert award (2012-2022).
Comments are closed.