Maintain control of your Microsoft 365 data
Post Reply
moh@dhigroup.com
Enthusiast
Posts: 25
Liked: 4 times
Joined: Jun 04, 2020 6:55 pm
Full Name: Morten Hemmingsen
Contact:

VBO Office365 Groups. Powershell. disabled options.

Post by moh@dhigroup.com »

I would like to add Office 365 Groups automatically to a backup job on an ongoing basis.
I use the following PowerShell script and it works fine. The problem is that when the groups are added to the job, "Mail," "Archive," "OneDrive" and "Site" are automatically enabled. I only want "Group Mail" and "Group Site" enabled. How do I disabled these four options for each Office 365 Group.
I have tried to use set-vbobackupitem without success.

Thanks
Morten

The script look like this:

<#
.NAME
Veeam Backup for Microsoft Office 365 Automatically Backup Office 365 Groups
.SYNOPSIS
Script to use for automatically adding Office 365 Groups to a backup job
.DESCRIPTION
Script to use for automatically adding Office 365 Groups to a backup job
Can be used in combination with Windows Task Schedule
Created for Veeam Backup for Microsoft Office 365 v4
Released under the MIT license.
.LINK
http://www.github.com/nielsengelen
#>
# Modify the values below to your needs
$Organization = "xxxx.onmicrosoft.com"
$BackupJob = "Office365Groups"
# Do not change below unless you know what you are doing
Import-Module "C:\Program Files\Veeam\Backup365\Veeam.Archiver.PowerShell\Veeam.Archiver.PowerShell.psd1"

# Get the Organization
$Org = Get-VBOOrganization -Name $Organization
# Leverage the Job which backs up the required Office 365 groups
$Job = Get-VBOJob -Name $BackupJob
# Get the Office 365 groups
$Groups = Get-VBOOrganizationGroup -Organization $Org -Type Office365

# Go through all the Office 365 groups and add them to the job
ForEach ($Group in $Groups) {
$Item = New-VBOBackupItem -Group $Group
Add-VBOBackupItem -Job $Job -BackupItem $Item
moh@dhigroup.com
Enthusiast
Posts: 25
Liked: 4 times
Joined: Jun 04, 2020 6:55 pm
Full Name: Morten Hemmingsen
Contact:

Re: VBO Office365 Groups. Powershell. disabled options.

Post by moh@dhigroup.com » 2 people like this post

I have figured it out.
I had to change this line:
Item = New-VBOBackupItem -Group $Group
To.
$Item = New-VBOBackupItem -Group $Group -Mailbox:$false -ArchiveMailbox:$false -OneDrive:$false -Sites:$false -GroupMailbox:$true -GroupSite:$true
Regards
Morten
Mike Resseler
Product Manager
Posts: 8191
Liked: 1322 times
Joined: Feb 08, 2013 3:08 pm
Full Name: Mike Resseler
Location: Belgium
Contact:

Re: VBO Office365 Groups. Powershell. disabled options.

Post by Mike Resseler »

Hi Morten,

First: Welcome to the forums!

Second: I love it when people find the solution themselves ;-). In all seriousness. Thanks for coming back with the solution, I am sure others will find this usefull also

Thanks
Mike
nielsengelen
Product Manager
Posts: 5797
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: VBO Office365 Groups. Powershell. disabled options.

Post by nielsengelen » 1 person likes this post

Thanks for using my script. I’ll add a note to it based upon your idea/request :-)
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
moh@dhigroup.com
Enthusiast
Posts: 25
Liked: 4 times
Joined: Jun 04, 2020 6:55 pm
Full Name: Morten Hemmingsen
Contact:

Re: VBO Office365 Groups. Powershell. disabled options.

Post by moh@dhigroup.com »

Thanks Mike and thanks Niels for writing the script 😀
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests