Maintain control of your Microsoft 365 data
Post Reply
habibalby
Veteran
Posts: 392
Liked: 33 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

PowerShell:Modify Exisiting User BackupItems

Post by habibalby »

Hello,
Following this thread which is answered by Marked and Polina; post304247.html?hilit=Powershell%20Set% ... em#p304247

I would like to modify couple of backup-items for multiple mailboxes within a Backup Job.

Code: Select all

$org=Get-VBOOrganization
$Repo = Get-VBORepository -Name "VeeamO365-IBM" 
$usernames = Get-Content -Path C:\Scripts\Users.txt
$Users=Get-VBOOrganizationUser -Organization $org| ?{$usernames.Contains($_.UserName)}

ForEach ($User in $Users)
{
Get-VBOOrganizationUser -Name $User -Organization $org
$backupItemUser = New-VBOBackupItem -User $users -Mailbox:$True -ArchiveMailbox:$False -OneDrive:$False
Set-VBOBackupItem -BackupItem $backupItemUser 
}
Any help much appreciated.

Regards,
whimark
Influencer
Posts: 18
Liked: 5 times
Joined: May 14, 2018 11:54 am
Full Name: Markus Johansson
Location: Gothenburg
Contact:

Re: PowerShell:Modify Exisiting User BackupItems

Post by whimark » 1 person likes this post

Its not very logical but you should use the add-vbobackupitem command to update a user, or group, in a job. That is how I update my users and groups if needed

Code: Select all

$org=Get-VBOOrganization
$Repo = Get-VBORepository -Name "VeeamO365-IBM" 
$usernames = Get-Content -Path C:\Scripts\Users.txt
$Users=Get-VBOOrganizationUser -Organization $org| ?{$usernames.Contains($_.UserName)}
$job = get-vbojob -name "xxxxxxxxxxx"

ForEach ($User in $Users)
{
Get-VBOOrganizationUser -Name $User -Organization $org
$backupItemUser = New-VBOBackupItem -User $users -Mailbox:$True -ArchiveMailbox:$False -OneDrive:$False
Add-VBOBackupItem -Job $job -BackupItem $backupItemUser
}
habibalby
Veteran
Posts: 392
Liked: 33 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

Re: PowerShell:Modify Exisiting User BackupItems

Post by habibalby »

Hi Mark,

Thank you once again for your help.. I will try it tomorrow and keep you posted.

Regards,
Polina
Veeam Software
Posts: 3191
Liked: 774 times
Joined: Oct 21, 2011 11:22 am
Full Name: Polina Vasileva
Contact:

Re: PowerShell:Modify Exisiting User BackupItems

Post by Polina » 1 person likes this post

@Markus, thank you for your assistance!

@Hussain, any success with modifying the jobs? Does it work for you now?
habibalby
Veteran
Posts: 392
Liked: 33 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

Re: PowerShell:Modify Exisiting User BackupItems

Post by habibalby »

Hi Polina & Markus,

Much appreciated, it worked.. :)

Regards,
Post Reply

Who is online

Users browsing this forum: Polina and 12 guests