Two *-VBRViReplicaJob cmdlets -suffix issue

PowerShell script exchange

Two *-VBRViReplicaJob cmdlets -suffix issue

Veeam Logoby snzhang2 » Fri Dec 02, 2016 8:07 pm

Hi,

I want to create a Replication job that has the suffix set to blank. The two cmdlet *-VBRViReplicaJob (Add- and Set-) doesn't accept empty string or null argument for the -suffix argument. But this is exactly what I want to do. Is there work-around this? This can be done through the GUI, so why put this restriction in the cmdlets?

Thanks,
Nan
snzhang2
Influencer
 
Posts: 22
Liked: 1 time
Joined: Wed Oct 12, 2016 3:17 pm
Full Name: Nan Zhang

Re: Two *-VBRViReplicaJob cmdlets -suffix issue

Veeam Logoby v.Eremin » Mon Dec 05, 2016 9:09 am

Have you tried to input space between quotes? I think this way a blank suffix will be created:

Code: Select all
asnp veeampssnapin
$Job = Get-VBRJob -name "Name of your replication job"
Set-VBRViReplicaJob -Job $Job -Suffix " "


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

Re: Two *-VBRViReplicaJob cmdlets -suffix issue

Veeam Logoby snzhang2 » Tue Dec 06, 2016 12:03 am

Thanks! The suggestion worked. And thanks for the code.

It is not intuitive. I am wondering if you can pass this quirk to writers of cmdlets to remove that restriction from the -suffix parameter in future releases.
snzhang2
Influencer
 
Posts: 22
Liked: 1 time
Joined: Wed Oct 12, 2016 3:17 pm
Full Name: Nan Zhang

Re: Two *-VBRViReplicaJob cmdlets -suffix issue

Veeam Logoby v.Eremin » Fri Dec 09, 2016 2:25 pm

The information has been provided to dev team. For now, kindly, leverage the proposed workaround. Thanks.
v.Eremin
Veeam Software
 
Posts: 13734
Liked: 1027 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

[MERGED] Create replica job with empty Suffix

Veeam Logoby GabesVirtualWorld » Tue Jan 17, 2017 11:09 am

Hi
Trying to create replica jobs between datacenters, but in the new datacenter I don't want any suffix on the VM. I can set this through the GUI to a blank value, but the Powershell command doesn't accept the -Suffix value to be an empty string.

Anyway to fix this?

Gabrie
GabesVirtualWorld
Service Provider
 
Posts: 140
Liked: 10 times
Joined: Mon Jun 15, 2009 10:49 am
Full Name: Gabrie van Zanten

Re: Create replica job with empty Suffix

Veeam Logoby tsightler » Tue Jan 17, 2017 3:04 pm

You can manually update the job settings using Set-VBRJobOptions immediately after creating the new job. Crude example:

Code: Select all
$newrepljob = Find-VBRViEntity -Name "dc01" | Add-VBRViReplicaJob -Name "DC Replication Job" -Server $server -Datastore $datastore -ResourcePool $resourcepool -Folder $folder -Description "DC server replication"
$newrepljob.ViReplicaTargetOptions.ReplicaNameSuffix = $null
Set-VBRJobOptions -Job $newrepljob -Options $newrepljob.Options
tsightler
Veeam Software
 
Posts: 4874
Liked: 1821 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Two *-VBRViReplicaJob cmdlets -suffix issue

Veeam Logoby v.Eremin » Wed Jan 18, 2017 5:29 pm

but the Powershell command doesn't accept the -Suffix value to be an empty string.

Setting a space between two quotes should be a way to go. Thanks.
v.Eremin
Veeam Software
 
Posts: 13734
Liked: 1027 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 1 guest