After you have completed your migration to Office 365 your attention will turn to how to backup all of your Office 365 data. I decided to use Veeam Backup for Office 365 for this task and in this post I’ll run through what you need to do to get it up and running step-by-step.
Preparing the Service Account
Ensure that you can connect to Office 365 using PowerShell on your Veeam server. These commands will download the modules you need:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted Register-PSRepository -Default Get-PSRepository Install-Module MSOnline
Then just run the below to connect to Office 365:
$UserCredential = Get-Credential Connect-MsolService -Credential $UserCredential $exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $UserCredential -Authentication "Basic" -AllowRedirection Import-PSSession $exchangeSession -DisableNameChecking
Download the Veeam Backup for Office 365 files from https://www.veeam.com/backup-microsoft-office-365-download.html
Create an account in Office 365 that you can use as a system account. This account should have a mailbox and will need permissions added as below:
New-ManagementRoleAssignment –Role ApplicationImpersonation –User "veeamO365@domain.com" New-ManagementRoleAssignment –Role “Organization Configuration” –User "veeamO365@domain.com" New-ManagementRoleAssignment –Role “View-Only Configuration” –User "veeamO365@domain.com" New-ManagementRoleAssignment –Role “View-Only Recipients” –User "veeamO365@domain.com" New-ManagementRoleAssignment –Role “Mailbox Search” –User "veeamO365@domain.com"
To see a list of all available roles run:
Get-MsolRole | Sort Name | Select Name,Description
Then to be able to backup SharePoint run:
Add-MsolRoleMember -RoleName “SharePoint Service Administrator” -RoleMemberEmailAddress veeamO365@domain.com
You should now be able to run the below using your service account:
get-organizationconfig
Installing Veeam Backup for Office 365
Run the Veeam.Backup365_2.0.0.567.msi file
Accept the agreement
Click Next
Click Install
Click Finish
Installing the Veeam Explorer for Exchange
Run the VeeamExplorerForExchange_9.6.3.567.msi file and click Next
Accept the agreement and click Next
Click Next
Click Install
Click Finish
Installing the Veeam Explorer for SharePoint
Run the VeeamExplorerForSharePoint_9.6.3.568.msi file and click Next
Accept the agreement and click Next
Click Next
Click Install
Click Finish
You should now have an icon on your desktop for Veeam Backup for Office 365, run this.
Click Connect
Adding your Organization
Right click on Organizations and click Add Organization
Select Microsoft Office 365
Leave the Region as Default and enter the username and password of the service account that you prepared earlier
Veeam will then check that the account is configured correctly, if all is ok click Finish.
Your Organization should now be available to be backed up
Add a backup repository
Click Backup Infrastructure then right click on Backup Repositories. Click Add a backup repository.
Give the backup repository a name and click Next
Enter the path to your storage, I used a UNC path for a network location, then click Next.
Specify a retention policy and then click Finish
Creating Backup Jobs
Click Organizations then right click on your organization and click backup
Give the backup job a name and click Next
Click Add and select what you want to backup
I am backing up a single user so select this from the list the click Add
Click Next
Click Next again
Select your Backup Repository and click Next
Configure scheduling options and click Create
Right click on the backup job and click Start to start now
You should now see the job status below
Hopefully you should then see a success status after its finished
Restoring emails
Right click on the backup job and click Explore latest Exchange state of <latest date> this will open the Veeam Explorer for Microsoft Exchange
Find your user and expand their mailbox, find the email you want to restore and right click on it. Click Restore to <username of user>. The mail appears back in the user’s mailbox
To list all users within your backup:
1. Open Veeam Console.
2. Navigate to Main Menu > PowerShell.
3. Run the command:
((Get-VBOOrganization | Get-VBOOrganizationUser | Where-Object -FilterScript {$_.IsBackedUp -eq $True -and $_.type -eq "User"}).DisplayName | Sort-Object) > C:\usersinbackup.txt
What confused me with Veeam for Office 365 is the retention. I’ve used it thinking my 6 month retention will retain my deleted items for 6 months. It actually only backs up emails/OneDrive/SharePoint files up to 6 months old, which is a bit pointless for my use case as an MSP. Otherwise it’s a great product with a lot of potential to grow.
Hello
Thank you for this great tutorial
Installed my first backup with ease
Some of the screens have changed as Veeam 0365 is on version: 5.0.1.179
And one of the roles
Add-MsolRoleMember -RoleName “SharePoint Administrator”
Looks like it is working?
The retention setting was confusing for me
I understood it as Veeam will backup all of your data that is up to a certain time old?
5 year retention will backup all data up to the data being 5 years old, then prune it from your backups?
Is this not correct?