Maintain control of your Microsoft Office 365 email data
Post Reply
habibalby
Expert
Posts: 379
Liked: 24 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

PowerShell:Modify Exisiting User BackupItems

Post by habibalby » Dec 19, 2018 12:46 pm

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 » Dec 19, 2018 1:34 pm 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
Expert
Posts: 379
Liked: 24 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 » Dec 19, 2018 2:40 pm

Hi Mark,

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

Regards,

Polina
Veeam Software
Posts: 876
Liked: 136 times
Joined: Oct 21, 2011 11:22 am
Full Name: Polina Vasileva
Contact:

Re: PowerShell:Modify Exisiting User BackupItems

Post by Polina » Dec 21, 2018 3:28 pm 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
Expert
Posts: 379
Liked: 24 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 » Dec 24, 2018 6:35 am

Hi Polina & Markus,

Much appreciated, it worked.. :)

Regards,

Post Reply

Who is online

Users browsing this forum: benyoung and 2 guests