PowerShell script exchange
LorettoCNY
Novice
Posts: 8 Liked: 4 times
Joined: May 12, 2015 12:56 pm
Full Name: Brandon
Contact:
Post
by LorettoCNY » May 19, 2015 2:38 pm
this post
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:
Post
by veremin » May 19, 2015 2:55 pm
this post
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:
Post
by LorettoCNY » May 19, 2015 3:12 pm
this post
Thank you, that worked!
veremin
Product Manager
Posts: 20406 Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » May 19, 2015 4:51 pm
this post
You're welcome. Feel free to ask, should other questions arise. Thanks.
Users browsing this forum: No registered users and 2 guests