-
- Enthusiast
- Posts: 29
- Liked: 1 time
- Joined: Oct 01, 2019 6:04 am
- Full Name: Sandip Saha
- Contact:
need to retention check for my all policy
Hello,
please help me how to get my backup copy job retention for my all policy
I have Long-Term Retention Policy (GFS) for my backup copy job policy some policy are 4 weeks some policies are 12 months
I need to know in every month my all policy retention time
anyone please help me for any api and powershell script
Thank
Sandip Saha
please help me how to get my backup copy job retention for my all policy
I have Long-Term Retention Policy (GFS) for my backup copy job policy some policy are 4 weeks some policies are 12 months
I need to know in every month my all policy retention time
anyone please help me for any api and powershell script
Thank
Sandip Saha
-
- Product Manager
- Posts: 9848
- Liked: 2607 times
- Joined: May 13, 2017 4:51 pm
- Full Name: Fabian K.
- Location: Switzerland
- Contact:
Re: need to retention check for my all policy
You can try that I have build the script in the last 15 minutes. It's functional, but not really optimized.
Code: Select all
# Getting all Backup Copy Jobs
$jobs = Get-VBRJob | Where-Object {($_.Jobtype -eq "BackupSync") -or ($_.Jobtype -eq "SimpleBackupCopyPolicy") }
# Loop through each Job to get the neccessary Information
$BackupCopyGFSSettings = $NULL
ForEach ($job in $Jobs) {
$options = Get-VBRJobOptions -Job $job
$tempObject =
[PSCustomObject]@{
JobName = $job.Name
WeeklyGFSEnabled = $options.GfsPolicy.Weekly.IsEnabled
WeeklyGFSRetention = $options.GfsPolicy.Weekly.KeepBackupsForNumberOfWeeks
WeeklyGFSDesiredTime = $options.GfsPolicy.Weekly.DesiredTime
MonthlyGFSEnabled = $options.GfsPolicy.Monthly.IsEnabled
MonthlyGFSRetention = $options.GfsPolicy.Monthly.KeepBackupsForNumberOfMonths
MonthlyGFSDesiredTime = $options.GfsPolicy.Monthly.DesiredTime
YearlyGFSEnabled = $options.GfsPolicy.Yearly.IsEnabled
YearlyGFSRetention = $options.GfsPolicy.Yearly.KeepBackupsForNumberOfYears
YearlyGFSDesiredTime = $options.GfsPolicy.Yearly.DesiredTime
}
$BackupCopyGFSSettings = [Array]$BackupCopyGFSSettings + $tempObject
}
$BackupCopyGFSSettings | ft
Product Management Analyst @ Veeam Software
-
- Enthusiast
- Posts: 29
- Liked: 1 time
- Joined: Oct 01, 2019 6:04 am
- Full Name: Sandip Saha
- Contact:
Re: need to retention check for my all policy
Hello Mildur,
thanks for your time and help
I will check and update you
Thank again
thanks for your time and help
I will check and update you
Thank again
-
- Product Manager
- Posts: 9848
- Liked: 2607 times
- Joined: May 13, 2017 4:51 pm
- Full Name: Fabian K.
- Location: Switzerland
- Contact:
Re: need to retention check for my all policy
Hi Sandip
Your welcome.
Your welcome.
Product Management Analyst @ Veeam Software
-
- Enthusiast
- Posts: 29
- Liked: 1 time
- Joined: Oct 01, 2019 6:04 am
- Full Name: Sandip Saha
- Contact:
Re: need to retention check for my all policy
Hello Mildur,
Thanks for your support
ones again I need help in my environment PS is disable only enable windows powershell ISE (x86)
in this shell I am not able to access get-vbrbackup
can anyone please help me how to enable veeam shell
Thanks
Sandip Saha
Thanks for your support
ones again I need help in my environment PS is disable only enable windows powershell ISE (x86)
in this shell I am not able to access get-vbrbackup
Code: Select all
PS C:\Windows\system32> Get-Module -ListAvailable Veeam*
Directory: C:\Program Files\Veeam\Backup and Replication\Console
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 1.0 Veeam.Backup.PowerShell
Directory: C:\Program Files\Veeam\Backup and Replication\Explorers\Exchange
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 2.0 Veeam.Exchange.PowerShell
Directory: C:\Program Files\Veeam\Backup and Replication\Explorers\SharePoint
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 2.0 Veeam.SharePoint.PowerShell
Directory: C:\Program Files\Veeam\Backup and Replication\Explorers\SQL
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 1.0 Veeam.SQL.PowerShell
Directory: C:\Program Files\Veeam\Backup and Replication\Explorers\ActiveDirectory
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 1.0 Veeam.ActiveDirectory.PowerShell
Directory: C:\Program Files\Veeam\Backup and Replication\Explorers\Oracle
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 1.0 Veeam.Oracle.PowerShell
Directory: C:\Program Files\Veeam\Backup and Replication\Explorers\Teams
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 2.0 Veeam.Teams.PowerShell
PS C:\Windows\system32> get-vbrbackup
get-vbrbackup : The term 'get-vbrbackup' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ get-vbrbackup
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (get-vbrbackup:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Windows\system32>
Thanks
Sandip Saha
-
- Product Manager
- Posts: 9848
- Liked: 2607 times
- Joined: May 13, 2017 4:51 pm
- Full Name: Fabian K.
- Location: Switzerland
- Contact:
Re: need to retention check for my all policy
Please use the 64bit Powershell ISE environment.
It does work with Windows Powershell ISE, but not with Windows Powershell ISE (x86).
It does work with Windows Powershell ISE, but not with Windows Powershell ISE (x86).
Product Management Analyst @ Veeam Software
-
- Enthusiast
- Posts: 29
- Liked: 1 time
- Joined: Oct 01, 2019 6:04 am
- Full Name: Sandip Saha
- Contact:
Re: need to retention check for my all policy
Dear Mildur,
Thanks for your time and support
Iam run your script and get below output
PS D:\> .\test.ps1
WARNING: This cmdlet is no longer supported for computer backup jobs. Use "Get-VBRComputerBackupJob" instead.
JobName WeeklyGFSEnabled WeeklyGFSRetention WeeklyGFSDesiredTime MonthlyGFSEnabled MonthlyGFSRetention MonthlyGFSDesiredTime YearlyGFSEnabled Yearl
yGFSR
etent
ion
------- ---------------- ------------------ -------------------- ----------------- ------------------- --------------------- ---------------- -----
MYSQL_10.10.10.10_DR Copy True 4 Sunday True 120 First False 1
MSSQL_10.1.00.00_DR Copy True 4 Sunday True 120 First False 10
Oracle_veeamrhelbkp_AML_LOS_DR_Copy True 4 Sunday True 120 First False
can you please help with completed date for weekly backup and monthly backup like below
Backup Copy Policy Weekly available backup Monthly available backup
mssql_10.1.00.00_DR Copy 8/22/2021 8/18/2021
Thanks for your time and support
Iam run your script and get below output
PS D:\> .\test.ps1
WARNING: This cmdlet is no longer supported for computer backup jobs. Use "Get-VBRComputerBackupJob" instead.
JobName WeeklyGFSEnabled WeeklyGFSRetention WeeklyGFSDesiredTime MonthlyGFSEnabled MonthlyGFSRetention MonthlyGFSDesiredTime YearlyGFSEnabled Yearl
yGFSR
etent
ion
------- ---------------- ------------------ -------------------- ----------------- ------------------- --------------------- ---------------- -----
MYSQL_10.10.10.10_DR Copy True 4 Sunday True 120 First False 1
MSSQL_10.1.00.00_DR Copy True 4 Sunday True 120 First False 10
Oracle_veeamrhelbkp_AML_LOS_DR_Copy True 4 Sunday True 120 First False
can you please help with completed date for weekly backup and monthly backup like below
Backup Copy Policy Weekly available backup Monthly available backup
mssql_10.1.00.00_DR Copy 8/22/2021 8/18/2021
-
- Product Manager
- Posts: 9848
- Liked: 2607 times
- Joined: May 13, 2017 4:51 pm
- Full Name: Fabian K.
- Location: Switzerland
- Contact:
Re: need to retention check for my all policy
Do you want to have a list with all GFS Restore Points or only when the latest weekly or monthly restore point was taken?
How many Jobs do you have? Only the three Copy jobs?
How many Jobs do you have? Only the three Copy jobs?
Product Management Analyst @ Veeam Software
-
- Enthusiast
- Posts: 29
- Liked: 1 time
- Joined: Oct 01, 2019 6:04 am
- Full Name: Sandip Saha
- Contact:
Re: need to retention check for my all policy
Hello Midur,
Thanks for your time and help
sorry for late replay
I need to take data all my GFS restore point details with all my all copy job
I have 72 copy jobs
details need like below
Thanks for your help
Thanks
Sandip Saha
Thanks for your time and help
sorry for late replay
I need to take data all my GFS restore point details with all my all copy job
I have 72 copy jobs
details need like below
Code: Select all
policy name weekly monthly
mssql_10.1.00.00_DR Copy 8/29/2021 8/1/2021
8/22/2021 9/5/2021
9/5/2021
9/12/2021
Thanks
Sandip Saha
-
- Veteran
- Posts: 643
- Liked: 312 times
- Joined: Aug 04, 2019 2:57 pm
- Full Name: Harvey
- Contact:
Re: need to retention check for my all policy
Hi Sandip,
If your goal is getting data on restore points and their corresponding backups, then use Get-VBRRestorePoint:
https://helpcenter.veeam.com/docs/backu ... ml?ver=110
Fabian's script has a way of getting all the Backup Copy Jobs; you'll then loop over those jobs and use Get-VBRBackup with -Name matching on the $Job.Name property. You can use the .GetBackup() method (I believe it's that) to avoid the extra cmdlet but if you're not familiar with powershell, use the cmdlet instead.
Once you have the backup object from Get-VBRBackup you can get the restore points, and that will print your list of restore points, including GFS data.
Try it in the shell and just play with it a bit, and then pick and choose what you want from the list, or make a custom object with
$SomeObject = [PSCustomObject]@{
Property1 = "thing1"
Property2 = "thing2"
...
}
It's not going to be sensible to build a tool for you I think, so instead, this is what you need to get the information for your report. Play with it a bit and see what you find.
If your goal is getting data on restore points and their corresponding backups, then use Get-VBRRestorePoint:
https://helpcenter.veeam.com/docs/backu ... ml?ver=110
Fabian's script has a way of getting all the Backup Copy Jobs; you'll then loop over those jobs and use Get-VBRBackup with -Name matching on the $Job.Name property. You can use the .GetBackup() method (I believe it's that) to avoid the extra cmdlet but if you're not familiar with powershell, use the cmdlet instead.
Once you have the backup object from Get-VBRBackup you can get the restore points, and that will print your list of restore points, including GFS data.
Try it in the shell and just play with it a bit, and then pick and choose what you want from the list, or make a custom object with
$SomeObject = [PSCustomObject]@{
Property1 = "thing1"
Property2 = "thing2"
...
}
It's not going to be sensible to build a tool for you I think, so instead, this is what you need to get the information for your report. Play with it a bit and see what you find.
-
- Enthusiast
- Posts: 29
- Liked: 1 time
- Joined: Oct 01, 2019 6:04 am
- Full Name: Sandip Saha
- Contact:
Re: need to retention check for my all policy
Hello,
Thanks For help
can you help me please one line code for my one policy so i am check same commend one by one.
I am new in powershell please help me
Thanks
Sandip Saha
Thanks For help
can you help me please one line code for my one policy so i am check same commend one by one.
I am new in powershell please help me
Thanks
Sandip Saha
-
- Product Manager
- Posts: 9848
- Liked: 2607 times
- Joined: May 13, 2017 4:51 pm
- Full Name: Fabian K.
- Location: Switzerland
- Contact:
Re: need to retention check for my all policy
I will do it later.
Product Management Analyst @ Veeam Software
-
- Enthusiast
- Posts: 29
- Liked: 1 time
- Joined: Oct 01, 2019 6:04 am
- Full Name: Sandip Saha
- Contact:
Re: need to retention check for my all policy
Hello,
any one please help me on this please
Thanks
Sandip Saha
any one please help me on this please
Thanks
Sandip Saha
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: need to retention check for my all policy
Hi Sandip,
The easiest way to differentiate restore points with GFS flags are by their storages. Example:
Then you can filter GFS ones by GfsPeriod, find their creation times and combine this information with job/policy name eventually transforming it into any report you like.
Best regards,
Oleg
The easiest way to differentiate restore points with GFS flags are by their storages. Example:
Code: Select all
$backup = Get-VBRBackup -Name 'Backup Name'
$rps = Get-VBRRestorePoint -Backup $backup
foreach ($rp in $rps) {
$storage = $rp.GetStorage()
$storage | select @{n='Name';e={$rp.Name}}, GfsPeriod, CreationTime
}
Best regards,
Oleg
-
- Enthusiast
- Posts: 29
- Liked: 1 time
- Joined: Oct 01, 2019 6:04 am
- Full Name: Sandip Saha
- Contact:
Re: need to retention check for my all policy
Hello Oleg,
thanks for your time and help
I am run this PowerShell commend but no output is show.
can you please help me
thanks for your time and help
I am run this PowerShell commend but no output is show.
can you please help me
Code: Select all
PS C:\Users\srvbackup\Desktop> $backup = Get-VBRBackup -Name 'MDM DB_Cluster_DR Copy'
$rps = Get-VBRRestorePoint -Backup $backup
foreach ($rp in $rps) {
$storage = $rp.GetStorage()
$storage | select @{n='Name';e={$rp.Name}}, GfsPeriod, CreationTime
}
PS C:\Users\srvbackup\Desktop>
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: need to retention check for my all policy
Do you happen to query backup made with backup copy job in immediate mode?
If you do, you need to get child backups first:
Thanks!
If you do, you need to get child backups first:
Code: Select all
$backup = Get-VBRBackup -Name 'MDM DB_Cluster_DR Copy'
$childBackups = $backup.FindChildBackups()
$rps = Get-VBRRestorePoint -Backup $childBackups[0]
-
- Enthusiast
- Posts: 29
- Liked: 1 time
- Joined: Oct 01, 2019 6:04 am
- Full Name: Sandip Saha
- Contact:
Re: need to retention check for my all policy
Hello,
Thanks For your time I am sorry I am still not get details Please help
in my environment our all copy job have gfs policy for monthly and weekly I need only below format
Please support me
Thanks
Thanks For your time I am sorry I am still not get details Please help
Code: Select all
PS C:\Windows\system32> $backup = Get-VBRBackup -Name 'MDM DB_Cluster_DR Copy'
PS C:\Windows\system32> $childBackups = $backup.FindChildBackups()
PS C:\Windows\system32> $rps = Get-VBRRestorePoint -Backup $childBackups[0]
PS C:\Windows\system32> foreach ($rp in $rps) {
>> $storage = $rp.GetStorage()
>> $storage | select @{n='Name';e={$rp.Name}}, GfsPeriod, CreationTime
>> }
PS C:\Windows\system32>
Code: Select all
policy name weekly monthly
mssql_10.1.00.00_DR Copy 8/29/2021 8/1/2021
8/22/2021 9/5/2021
9/5/2021
9/12/2021
Please support me
Thanks
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: need to retention check for my all policy
Sandip,
I'd suggest you to perform a very basic debugging: start with figuring out if any of your variables return null values. Given that there is no error thrown, I'd say it's the method causing this issue. Cmdlets do return null exceptions if anything of null value is passed.
Thanks,
Oleg
I'd suggest you to perform a very basic debugging: start with figuring out if any of your variables return null values. Given that there is no error thrown, I'd say it's the method causing this issue. Cmdlets do return null exceptions if anything of null value is passed.
Thanks,
Oleg
-
- Enthusiast
- Posts: 29
- Liked: 1 time
- Joined: Oct 01, 2019 6:04 am
- Full Name: Sandip Saha
- Contact:
Re: need to retention check for my all policy
Oleg,
sorry for this I am new in PowerShell with veeam
Can you please help me in one policy for me.
thanks for time and help
Thanks
Sandip
sorry for this I am new in PowerShell with veeam
Can you please help me in one policy for me.
thanks for time and help
Thanks
Sandip
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: need to retention check for my all policy
Sandip,
I understand, but it's not about Veeam powershell module.
It's about very common troubleshooting steps you would try with any script, cmdlet, object etc.
This forum doesn't teach powershell, it provides help with meanings, design and structure of VBR PS module entities.
I have given you all the necessary steps to get the script running, now it is the matter of general powershell knowledge.
If you are completely new to powershell, I would rather start with this documentation.
Thanks,
Oleg
I understand, but it's not about Veeam powershell module.
It's about very common troubleshooting steps you would try with any script, cmdlet, object etc.
This forum doesn't teach powershell, it provides help with meanings, design and structure of VBR PS module entities.
I have given you all the necessary steps to get the script running, now it is the matter of general powershell knowledge.
If you are completely new to powershell, I would rather start with this documentation.
Thanks,
Oleg
-
- Enthusiast
- Posts: 29
- Liked: 1 time
- Joined: Oct 01, 2019 6:04 am
- Full Name: Sandip Saha
- Contact:
Re: need to retention check for my all policy
Oleg,
Thanks for your time and support.
I am understand but
as in our environment all copy job policy heaving weekly and monthly GFS policy I am try Get-VBRBackup and Get-VBRRestorePoint but I am not getting any output for GFS details
I need help for only one policy getting how many weekly and monthly GFS restore point details.
in gui >> go to >>> diskcopy>> right click on policy >>> properties>>> its showing all restore point details
Please help how to get this details in PowerShell.
Thanks
Sandip Saha
Thanks for your time and support.
I am understand but
as in our environment all copy job policy heaving weekly and monthly GFS policy I am try Get-VBRBackup and Get-VBRRestorePoint but I am not getting any output for GFS details
I need help for only one policy getting how many weekly and monthly GFS restore point details.
in gui >> go to >>> diskcopy>> right click on policy >>> properties>>> its showing all restore point details
Please help how to get this details in PowerShell.
Thanks
Sandip Saha
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: need to retention check for my all policy
Did you try to follow those basic troubleshooting steps I wrote above? Thanks!
-
- Enthusiast
- Posts: 29
- Liked: 1 time
- Joined: Oct 01, 2019 6:04 am
- Full Name: Sandip Saha
- Contact:
Re: need to retention check for my all policy
hello Oleg,
Thanks for your help
sorry for my query
I need only how to collect my weekly and monthly GFS restore point details for one copy job.
please help the PowerShell commend
Thanks
Thanks for your help
sorry for my query
I need only how to collect my weekly and monthly GFS restore point details for one copy job.
please help the PowerShell commend
Thanks
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: need to retention check for my all policy
Sandip, I think we are going around in circles here. I did help you with the working script, which I tested in my environment. Apparently, there is something else about your case or this query that causes null values somewhere in the script and eventually gives no output. However, I cannot help you further if I don't know where are these null values coming from. Since I don't see the same behaviour in my lab, I asked you for basic troubleshooting on your side. I cannot do such troubleshooting for you, I can only suggest steps for it.
Who is online
Users browsing this forum: No registered users and 13 guests