Why does ImportVBRBackup use -Server instead of -Name?

PowerShell script exchange

Why does ImportVBRBackup use -Server instead of -Name?

Veeam Logoby nd39475 » Sun Jul 23, 2017 5:48 pm

Why does ImportVBRBackup use -Server (FQDN) instead of -Name.

I'm having to force the FQDN like below which does not flow with other VBR cmdlets.
Code: Select all
$VeeamServer="MyServerHostName"
Get-VBRBackupRepository -Name $VeeamServer
[....stuff...]
Import-VBRBackup -Server "$VeeamServer.$env:USERDNSDOMAIN" -FileName "blahblah"

and this only works because my veeam server name happens to be the hostname. If it were different it would be more of a PITA:

I can't even use $FQDN=(Get-VBRBackupRepository -Name $VeeamServer).Host because ".Host" is not usable even though it's a table header returned by Get-VBRBackupRepository.

Also, off subject, Get-VBRBackupRepository's .FullPath property returns "E:|Backups" instead of "E:\Backups"
nd39475
Influencer
 
Posts: 19
Liked: 2 times
Joined: Thu May 05, 2016 6:28 pm
Full Name: n d

Re: Why does ImportVBRBackup use -Server instead of -Name?

Veeam Logoby v.Eremin » Mon Jul 24, 2017 1:01 pm

The import wizard in backup server allows you to import backup from any server added to the backup console. It uses FQDN under which servers were added to the backup console. PowerShell cmdlet follows the same pattern. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Why does ImportVBRBackup use -Server instead of -Name?

Veeam Logoby nd39475 » Mon Jul 24, 2017 2:05 pm

Thank you, I'd like to formally request a fix of
Code: Select all
(Get-VBRBackupRepository -Name $VeeamServer).Host

and less importantly
Code: Select all
(Get-VBRBackupRepository -Name $VeeamServer).FullPath
nd39475
Influencer
 
Posts: 19
Liked: 2 times
Joined: Thu May 05, 2016 6:28 pm
Full Name: n d

Re: Why does ImportVBRBackup use -Server instead of -Name?

Veeam Logoby v.Eremin » Mon Jul 24, 2017 2:17 pm

1) Import-VBRBackup cmdlet –°Host as -Server parameter, not a string one. It seems that you're trying to address the problem from a different angle. Thus, the concern regarding internal parameter .Host that servers a different purpose.
2) .Path parameter seems to have a formatting you're after.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Why does ImportVBRBackup use -Server instead of -Name?

Veeam Logoby nd39475 » Mon Jul 24, 2017 2:37 pm

It seems if i could get the FQDN or HostName of a server from Get-VBRBackupRepository or Get-VBRServer, then i'd be able to use it for Import-VBRBackup -Server rather than having to set 2 different variables representing a veeam server. (Name & Server) -- It's just a logic issue to me.

Yes, both .FriendlyPath and .Path are circumventions to the erroneous .Fullpath .

Thank you.
nd39475
Influencer
 
Posts: 19
Liked: 2 times
Joined: Thu May 05, 2016 6:28 pm
Full Name: n d

Re: Why does ImportVBRBackup use -Server instead of -Name?

Veeam Logoby tsightler » Mon Jul 24, 2017 3:11 pm

As noted above, the -Server parameter normally doesn't want a string, it wants a [CHost} object. The Get-VBRServer cmdlet returns [CHost] objects, and allows filter by Name so, assuming the hosts were added to VBR by FQDN, then something like this:

Import-VBRBackup -Server (Get-VBRServer -Name "myrepo.foobar.com")


The cmdlet will also accept a repository object [CBackupRepostiory] via the -Repository parameter:

Import-VBRBackup -Repository (Get-VBRBackupRepository -Name "My Repo")


You don't need the FQDN strings, if you have either the [CHost] object or the [CBackupRepostiory] object, just pass the entire object to the parameter. In other words, you initial code should just be:

Code: Select all
$VeeamServer="MyServerHostName"
Get-VBRBackupRepository -Name $VeeamServer
[....stuff...]
Import-VBRBackup -Repository "$VeeamServer" -FileName "blahblah"
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Why does ImportVBRBackup use -Server instead of -Name?

Veeam Logoby nd39475 » Mon Jul 24, 2017 3:28 pm

Awesome, TYVM.
nd39475
Influencer
 
Posts: 19
Liked: 2 times
Joined: Thu May 05, 2016 6:28 pm
Full Name: n d


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 2 guests