Get Job name from VM

PowerShell script exchange

Get Job name from VM

Veeam Logoby rsarnold1s » Thu May 05, 2016 10:48 pm

Hello-

Wondering if it is possible to provide a VM name and list all the jobs that contain that VM? My goal here is to create a server decommission script that would remove a VM from any jobs it is currently a member of.
rsarnold1s
Influencer
 
Posts: 11
Liked: never
Joined: Thu May 05, 2016 10:33 pm

Re: Get Job name from VM

Veeam Logoby v.Eremin » Fri May 06, 2016 9:54 am

Is this VM added as individual VM or through container (folder, resource pool, etc.) to backup jobs? Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get Job name from VM

Veeam Logoby rsarnold1s » Fri May 06, 2016 3:34 pm

It is added as an individual VM.
rsarnold1s
Influencer
 
Posts: 11
Liked: never
Joined: Thu May 05, 2016 10:33 pm

Re: Get Job name from VM

Veeam Logoby v.Eremin » Fri May 06, 2016 3:51 pm

Then, try the following script:

Code: Select all
asnp VeeamPSSnapin
Get-VBRJob | where {$_.GetObjectsInJob().name -eq "Name of your VM"} | select name


Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get Job name from VM

Veeam Logoby rsarnold1s » Fri May 06, 2016 3:55 pm

Perfect, thank you!
rsarnold1s
Influencer
 
Posts: 11
Liked: never
Joined: Thu May 05, 2016 10:33 pm


Return to PowerShell



Who is online

Users browsing this forum: robbysmith and 5 guests