PowerShell script exchange
Post Reply
decoy5657
Influencer
Posts: 12
Liked: 3 times
Joined: Oct 09, 2013 2:45 pm
Full Name: Aaron Anderson
Contact:

Exclude VM's from job; duplicates...

Post by decoy5657 »

Each time I run this, I get a new "copy" of the machine in the exclusion list...

Code: Select all

### Exclude SQL from Development job
$DevSqlBoxes = Get-VBRJob -name "Development" | Get-VBRJobObject  | Where-Object {$_.Name -like "*dvsql*"}
Foreach ($DevSqlBox in $DevSqlBoxes)
{
$DevSqlBox | Remove-VBRJobObject 
}  

Is there a way to avoid this? Perhaps completely remove ALL objects from the backup, including exclusions, and then re-add.
decoy5657
Influencer
Posts: 12
Liked: 3 times
Joined: Oct 09, 2013 2:45 pm
Full Name: Aaron Anderson
Contact:

Re: Exclude VM's from job; duplicates...

Post by decoy5657 » 1 person likes this post

I just added the -Completely option... so... problem solved.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Exclude VM's from job; duplicates...

Post by veremin »

Hi, Aaron. Though, please, be aware that with the said flag the script won’t just temporarily exclude given VMs, instead, it will remove them from the job completely.

Thanks.
decoy5657
Influencer
Posts: 12
Liked: 3 times
Joined: Oct 09, 2013 2:45 pm
Full Name: Aaron Anderson
Contact:

Re: Exclude VM's from job; duplicates...

Post by decoy5657 »

Yes, for this instance, that's what I want to do.
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests