PowerShell script exchange
Post Reply
LorettoCNY
Novice
Posts: 8
Liked: 4 times
Joined: May 12, 2015 12:56 pm
Full Name: Brandon
Contact:

Disabling a Tape Copy job

Post by LorettoCNY »

I'm trying to disable a tape copy job via powershell. I've found some examples on the forum, but it's not working in my environment.

Code:

Code: Select all

$EndPointTapeJob = Get-VBRTapeJob | where {$_.Name -Like "*Endpoint*"}
foreach ($Job in Get-VBRTapeJob | where {$_.Name -Like "*Endpoint*"})
{
    $Job.DisableScheduler()
}
Error:

Code: Select all

Method invocation failed because [Veeam.Backup.PowerShell.Infos.VBRBackupToTapeJob] does not contain a method named
'DisableScheduler'.
At C:\Users\backup\Desktop\test.ps1:8 char:5
+     $Job.DisableScheduler()
+     ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound
veremin
Product Manager
Posts: 20406
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Disabling a Tape Copy job

Post by veremin »

Try to change the code slightly and see whether it helps. By the way the first line seems to be unnecessary:

Code: Select all

foreach ($Job in Get-VBRTapeJob | where {$_.Name -Like "*Endpoint*"})
{
    Disable-VBRJob -Job $Job
}
Thanks.
LorettoCNY
Novice
Posts: 8
Liked: 4 times
Joined: May 12, 2015 12:56 pm
Full Name: Brandon
Contact:

Re: Disabling a Tape Copy job

Post by LorettoCNY »

Thank you, that worked!
veremin
Product Manager
Posts: 20406
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Disabling a Tape Copy job

Post by veremin »

You're welcome. Feel free to ask, should other questions arise. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests