Disabling a Tape Copy job

PowerShell script exchange

Disabling a Tape Copy job

Veeam Logoby LorettoCNY » Tue May 19, 2015 2:38 pm

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
LorettoCNY
Novice
 
Posts: 8
Liked: 3 times
Joined: Tue May 12, 2015 12:56 pm
Full Name: Brandon

Re: Disabling a Tape Copy job

Veeam Logoby v.Eremin » Tue May 19, 2015 2:55 pm

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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 969 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Disabling a Tape Copy job

Veeam Logoby LorettoCNY » Tue May 19, 2015 3:12 pm

Thank you, that worked!
LorettoCNY
Novice
 
Posts: 8
Liked: 3 times
Joined: Tue May 12, 2015 12:56 pm
Full Name: Brandon

Re: Disabling a Tape Copy job

Veeam Logoby v.Eremin » Tue May 19, 2015 4:51 pm

You're welcome. Feel free to ask, should other questions arise. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 969 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests