-
- Enthusiast
- Posts: 28
- Liked: 3 times
- Joined: Mar 18, 2016 8:16 pm
- Full Name: Ryan
- Contact:
Check back copy job is disable or enable
Hi there,
Is there any way to check a back copy job is disabled or enabled?
I need to know the status of the job, so I can run the rest of the script smoothly.
Thank you
Ryan
Is there any way to check a back copy job is disabled or enabled?
I need to know the status of the job, so I can run the rest of the script smoothly.
Thank you
Ryan
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Check back copy job is disable or enable
Try the following example:
Thanks.
Code: Select all
$Job = Get-VBRJob -Name "Name of backup to tape job"
$Job.info.IsScheduleEnabled
-
- Enthusiast
- Posts: 28
- Liked: 3 times
- Joined: Mar 18, 2016 8:16 pm
- Full Name: Ryan
- Contact:
Re: Check back copy job is disable or enable
Just a further question:
what is difference between $Job.EnableScheduler() and Enable-VBRJob ?
Thanks
what is difference between $Job.EnableScheduler() and Enable-VBRJob ?
Thanks
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Check back copy job is disable or enable
Both internal method and commandlet work exactly the same. Thanks.
-
- Product Manager
- Posts: 5796
- Liked: 1215 times
- Joined: Jul 15, 2013 11:09 am
- Full Name: Niels Engelen
- Contact:
Re : Check back copy job is disable or enable
The following will see if the job is stopped (disabled) or not (running):
Code: Select all
$job = Get-VBRJob -Name "BACKUPCOPYJOBNAME"
if (!$job.IsStopped()) {
Write-Output "Enabled"
} else {
Write-Output "Disabled"
}
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
GitHub: https://github.com/nielsengelen
-
- Influencer
- Posts: 24
- Liked: never
- Joined: Jul 06, 2017 6:07 am
- Contact:
[MERGED] Get all disabled VBR Jobs
Hi
I need help getting all disabled VBR Jobs and displaying them together with the job description. I cannot find a state or "isDisabled" member of a VBRJOB or VBRSession, and "isStopped" applies to all stopped jobs - which are all that are not failed.
Thanks for your help
I need help getting all disabled VBR Jobs and displaying them together with the job description. I cannot find a state or "isDisabled" member of a VBRJOB or VBRSession, and "isStopped" applies to all stopped jobs - which are all that are not failed.
Thanks for your help
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Check back copy job is disable or enable
Try the example provided above. As to description, you can find it here:
Thanks.
Code: Select all
asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your job"
$Job.info.Description
-
- Influencer
- Posts: 24
- Liked: never
- Joined: Jul 06, 2017 6:07 am
- Contact:
Re: Check back copy job is disable or enable
Thanks for your reply.
Somehow I still cannot get it to work:
Using this
I get the error
[Veeam.Backup.Model.CDbBackupJobInfo] does not contain a method named 'IsScheduleEnabled'.
When I try this
I get "Disabled" for all Jobs currently not running. But I would need only the disabled ones.
I then tried something like this
Which seems to work, but I am not good enough on powershell to then check the VBRJob Members against anything - I only have the JobSchedule Object in this case.
Any help appreciated
Somehow I still cannot get it to work:
Using this
Code: Select all
$job = Get-VBRJob -name "Backup Job Name"
$Job.info.IsScheduleEnabled()
[Veeam.Backup.Model.CDbBackupJobInfo] does not contain a method named 'IsScheduleEnabled'.
When I try this
Code: Select all
if (!$job.IsStopped()) {
Write-Output "Enabled"
} else {
Write-Output "Disabled"
}
I then tried something like this
Code: Select all
$jobs = Get-VBRJob |Get-VBRJobScheduleOptions| where{$_.NextRun -eq ""}
Any help appreciated
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Check back copy job is disable or enable
Try to rewrite original script slightly:
Thanks.
Code: Select all
Get-VBRJob | where {$_.IsScheduleEnabled -eq $False} | select name, {$_.info.description}
-
- Influencer
- Posts: 24
- Liked: never
- Joined: Jul 06, 2017 6:07 am
- Contact:
Re: Check back copy job is disable or enable
Works great, thanks a lot!
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Check back copy job is disable or enable
You're welcome. Feel free to contact us, if other questions arise. Thanks.
Who is online
Users browsing this forum: No registered users and 19 guests