Veeam Backup & Replication 5.0
I try to add a Backupjob with Powershell, use the following Command
> Add-VBRBackupJob -Name "Backup01" -Type VDDK -Server "svesxp02" -Folder $vbrfolder -FileName $vbrfile -Objects SVMigration
Then i receive the Message:
Add-VBRBackupJob : Cannot bind parameter 'Server'. Cannot convert the "svesxp02" value of type "System.String" to type "Veeam.Backup.Core.CHost"
.
At line:1 char:54
+ Add-VBRBackupJob -Name $vbrjobname -Type VDDK -Server <<<< "svesxp02" -Folder $vbrfolder -FileName $vbrfile -Objects SVMigration
+ CategoryInfo : InvalidArgument: (:) [Add-VBRBackupJob], Paramet
erBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Veeam.Backup.Powe
rShell.Command.AddVBRJobBackup
Anybody have an Idea ?
Greetings
JM
-
- Novice
- Posts: 4
- Liked: never
- Joined: Dec 07, 2010 7:53 am
- Full Name: Jürgen Metten
- Contact:
Re: Add Job with Powershell
Hello Jürgen,
The problem is in type casting. You're specifying String parameter, and the function needs a variable of Veeam.Backup.Core.CHost type. You should use use Get-VBRServer function to obtain an object of the requested type. Here is an example:
Should work!
The problem is in type casting. You're specifying String parameter, and the function needs a variable of Veeam.Backup.Core.CHost type. You should use use Get-VBRServer function to obtain an object of the requested type. Here is an example:
Code: Select all
$server = Get-VBRServer | where {$_.Name -eq "svesxp02"}
Add-VBRBackupJob -Name "Backup01" -Type VDDK -Server $server -Folder $vbrfolder -FileName $vbrfile -Objects SVMigration
-
- Enthusiast
- Posts: 38
- Liked: never
- Joined: Jan 01, 2006 1:01 am
- Contact:
Re: Add Job with Powershell
Is this available in the manual for the product?Alexey D. wrote:Hello Jürgen,
The problem is in type casting. You're specifying String parameter, and the function needs a variable of Veeam.Backup.Core.CHost type. You should use use Get-VBRServer function to obtain an object of the requested type. Here is an example:
Should work!Code: Select all
$server = Get-VBRServer | where {$_.Name -eq "svesxp02"} Add-VBRBackupJob -Name "Backup01" -Type VDDK -Server $server -Folder $vbrfolder -FileName $vbrfile -Objects SVMigration
-
- Novice
- Posts: 4
- Liked: never
- Joined: Dec 07, 2010 7:53 am
- Full Name: Jürgen Metten
- Contact:
Re: Add Job with Powershell
Hello Alexey,
it works !
Thank you for support !
it works !
Thank you for support !
Re: Add Job with Powershell
You're welcome, Jürgen!
The description of PowerShell functions along with list of parameters and their purposes is available via PS command line. Generic information and a couple of examples can be found via Help->Help menu item of B&R console. If you need more scripts, please search through this forum as community users contribute a lot and share various code pretty often! Hope it helps.
Do you mean this example? No, it was generated by one of our QA engineers and me.Is this available in the manual for the product?
The description of PowerShell functions along with list of parameters and their purposes is available via PS command line. Generic information and a couple of examples can be found via Help->Help menu item of B&R console. If you need more scripts, please search through this forum as community users contribute a lot and share various code pretty often! Hope it helps.
Who is online
Users browsing this forum: No registered users and 3 guests