-
- Influencer
- Posts: 18
- Liked: never
- Joined: Mar 16, 2022 12:44 pm
- Full Name: Ben Curtis-Haigh
- Contact:
Veeam PowerShell - Replication Intervals
Hello,
Is anyone aware of a command in which you can pull the replication interval of every job via PowerShell.
For example, if a job has a schedule to periodically replicate every 30 mins, I would like to get that via PowerShell.
Kind Regards
Ben
Is anyone aware of a command in which you can pull the replication interval of every job via PowerShell.
For example, if a job has a schedule to periodically replicate every 30 mins, I would like to get that via PowerShell.
Kind Regards
Ben
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Veeam PowerShell - Replication Intervals
Hi Ben,
Can you tell me which types of replication jobs you are after? I'm asking because the approaches will vary for VMware/Hyper-V, vCD and CDP types.
Thanks,
Oleg
Can you tell me which types of replication jobs you are after? I'm asking because the approaches will vary for VMware/Hyper-V, vCD and CDP types.
Thanks,
Oleg
-
- Product Manager
- Posts: 9848
- Liked: 2607 times
- Joined: May 13, 2017 4:51 pm
- Full Name: Fabian K.
- Location: Switzerland
- Contact:
Re: Veeam PowerShell - Replication Intervals
Hi Ben
This is a simple script which works for HyperV and vSphere Replica Jobs.
It gives you a list with JobName, Periodic enabled or not, Interval Unit and the configured interval:
This is a simple script which works for HyperV and vSphere Replica Jobs.
It gives you a list with JobName, Periodic enabled or not, Interval Unit and the configured interval:
Code: Select all
$ReplicaJobs = Get-VBRJob | where {$_.TypeToString -like "*Replication*"}
$ReplicaJobs | select name,@{Name="Periodic"; Expression={ $_.scheduleOptions.OptionsPeriodically.Enabled}},@{Name="Unit"; Expression={ $_.scheduleOptions.OptionsPeriodically.Kind}},@{Name="Interval"; Expression={ $_.scheduleOptions.OptionsPeriodically.FullPeriod}} | sort Name | ft -autosize
Product Management Analyst @ Veeam Software
-
- Influencer
- Posts: 18
- Liked: never
- Joined: Mar 16, 2022 12:44 pm
- Full Name: Ben Curtis-Haigh
- Contact:
Re: Veeam PowerShell - Replication Intervals
Hey, that is perfect. Just what I was looking for. thank you!
-
- Influencer
- Posts: 18
- Liked: never
- Joined: Mar 16, 2022 12:44 pm
- Full Name: Ben Curtis-Haigh
- Contact:
Re: Veeam PowerShell - Replication Intervals
Hey, I am trying to also include the LatestRunLocal time/date so I can compare to see if things are over running. How do I pull that individual value too. I have tried modifying the script but not getting anywhere...
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Veeam PowerShell - Replication Intervals
Sure, you can pull it from the schedule options:
Thanks!
Code: Select all
$replicaJobs = Get-VBRJob | where {$_.TypeToString -like '*Replication*'}
$replicaJobs | select Id, Name, @{n='LatestRunLocal';e={$_.ScheduleOptions.LatestRunLocal}}
-
- Influencer
- Posts: 18
- Liked: never
- Joined: Mar 16, 2022 12:44 pm
- Full Name: Ben Curtis-Haigh
- Contact:
Re: Veeam PowerShell - Replication Intervals
Cheers appreciate that, the LatestRunLocal might not be what I am looking for them as the dates dont see right. I want to find out how long the job has been running for. I.e. 35 minutes etc. And have that value in a variable alongside the interval. I can then compare them both.
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Veeam PowerShell - Replication Intervals
Then you are most probably after duration property contained in a session object. The workflow is to query the last session for each job and then obtain value in CBackupSession.Progress.Duration. Example:
As for the LatestRunLocal property, you are right, it looks off. I used CBackupSession.CreationTime property in my case as a LatestRunLocal determinator.
Best regards,
Oleg
Code: Select all
$replicaJobs = Get-VBRJob | where {$_.TypoToString -like "*Replication*"}
$sessions = Get-VBRBackupSession
foreach ($job in $replicaJobs) {
$session = $sessions | where {$_.JobId -eq $job.Id} | sort -Property EndTime | select -Last 1
$job | select Id, Name, @{n='LatestRunLocal';e={$session.CreationTime}}, @{n='Duration';e={$session.Progress.Duration}}
}
Best regards,
Oleg
Who is online
Users browsing this forum: No registered users and 4 guests