-
- Influencer
- Posts: 19
- Liked: never
- Joined: Oct 09, 2013 2:18 pm
- Full Name: Piotr Brzozowski
- Contact:
"Remove deleted items data after" value in Powershell
Hi,
Does anybody know how to change in Powershell "Remove deleted items data after" value (Storage -> Advanced -> Maintenance -> Full backup file maintenance) in VBR job?
Thanks
Does anybody know how to change in Powershell "Remove deleted items data after" value (Storage -> Advanced -> Maintenance -> Full backup file maintenance) in VBR job?
Thanks
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: "Remove deleted items data after" value in Powershell
Try this script:
Thanks!
Code: Select all
Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your job"
$Options = $Job.GetOptions()
$Options.backupstorageoptions.retaindays = "Value that you want to set"
Set-VBRJobOptions -Job $Job -Options $Options
-
- Influencer
- Posts: 19
- Liked: never
- Joined: Oct 09, 2013 2:18 pm
- Full Name: Piotr Brzozowski
- Contact:
Re: "Remove deleted items data after" value in Powershell
Hi,
It works!
Thanks
It works!
Thanks
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: "Remove deleted items data after" value in Powershell
You're welcome.
Basically, all job settings are distributed among different option set in $Job.GetOptions(). For instance, backup job advanced storage settings can be found in $Options.BackupStorageOptions, backup job advanced notifications settings - in $Options.NotificationOptions, etc.
So, whenever you struggle with finding the necessary property in PS, just change it in GUI and locate where it gets reflected in option set and, then, write a script, using the approach above.
Thanks!
Basically, all job settings are distributed among different option set in $Job.GetOptions(). For instance, backup job advanced storage settings can be found in $Options.BackupStorageOptions, backup job advanced notifications settings - in $Options.NotificationOptions, etc.
So, whenever you struggle with finding the necessary property in PS, just change it in GUI and locate where it gets reflected in option set and, then, write a script, using the approach above.
Thanks!
-
- Influencer
- Posts: 14
- Liked: never
- Joined: Apr 24, 2015 1:40 pm
- Contact:
Re: "Remove deleted items data after" value in Powershell
I want to thank you for this thread, I just ran into a bug (Case # 03365723) in 9.5u4 with Backup Copy jobs and needed to follow these instructions to get it working again.
Code: Select all
$job = Get-VBRJob -Name "Name of your job"
$options = $job.GetOptions()
$options.generationpolicy.DeletedVmsDataRetentionPeriodDays = "30"
Set-VBRJobOptions -Job $job -Options $options
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: "Remove deleted items data after" value in Powershell
Not sure whether I follow you on that. Are saying that this script stopped working, after you had upgraded to Update 4? Thanks.
-
- Influencer
- Posts: 14
- Liked: never
- Joined: Apr 24, 2015 1:40 pm
- Contact:
Re: "Remove deleted items data after" value in Powershell
The console stopped working in U4 if the value for that field is (the default) 180, even if the check mark is unchecked. So I needed to use the Powershell in order to adjust the number of days in order to access the Advanced settings.
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: "Remove deleted items data after" value in Powershell
Ah, I didn't get at first that it wasn't the script that didn't work
Good to know that the script helped you to fix the issue.
Thanks!
Good to know that the script helped you to fix the issue.
Thanks!
Who is online
Users browsing this forum: Majestic-12 [Bot] and 6 guests