Hello,
Is it possible to exclude an object in job ?
I can add an VM in a job with this command Add-VBRJobObject -Job $job -Server $vcenter -Object $object
But how to exclude this object in the job ?
			
			
									
						
										
						- 
				oz07
 - Service Provider
 - Posts: 1
 - Liked: never
 - Joined: Dec 09, 2011 1:01 pm
 - Contact:
 
- 
				ThomasMc
 - Veteran
 - Posts: 293
 - Liked: 19 times
 - Joined: Apr 13, 2011 12:45 pm
 - Full Name: Thomas McConnell
 - Contact:
 
Re: Exclude Object in job
Sure is
The VM will still be in the job and a a exclusion rule will get applied
			
			
									
						
										
						Code: Select all
$job = Get-VBRJob -Name "Job Name"
$obj = $job | Get-VBRJobObject
$exclude = $obj | ?{$_.Name -eq "VM to Exclude"}
Remove-VBRJobObject -Job $job -Object $exclude
- 
				ThomasMc
 - Veteran
 - Posts: 293
 - Liked: 19 times
 - Joined: Apr 13, 2011 12:45 pm
 - Full Name: Thomas McConnell
 - Contact:
 
Re: Exclude Object in job
And a v6 one 
			
			
									
						
										
						Code: Select all
Get-VBRJob -Name "Job Name" | Get-VBRJobObject -Name "VMToExclude" | Remove-VBRJobObject
- 
				Gostev
 - Chief Product Officer
 - Posts: 32792
 - Liked: 7994 times
 - Joined: Jan 01, 2006 1:01 am
 - Location: Baar, Switzerland
 - Contact:
 
Re: Exclude Object in job
I must admit I like v6 PowerShell so much better 
			
			
									
						
										
						Who is online
Users browsing this forum: No registered users and 7 guests