02-12-2015 04:47 AM
Hi,
I would like to use the new feature in BackupExec 2014 for using Powershell and NDMP.
I follow the example avalaible in the Help as follow:
C:\PS> $x = New-BENdmpNetAppServerSelection -Volume "/vol/vol1" -Path "/testfolder" -Recurse:$true
C:\PS> Get-BEAgentServer "NetAppServer" | New-BEBackupDefinition -BackupJobDefault BackupToDisk | Add-BEBackupSelection $x | Save-BEBackupDefinition
(of course I replace "NetappServer" with my Netapp server name that can I also see via Get-BEAgentServer)
The error result is :
Add-BEBackupSelection : Cannot bind parameter 'AgentServer'. Cannot convert the
"/testfolder/*.*" value of type "BackupExec.Management.CLI.BENdmpNetAppServerS
election" to type "BackupExec.Management.CLI.BEAgentServer".
At line:1 char:121
+ Get-BEAgentServer "myservername" | New-BEBackupDefinition -BackupJobD
efault BackupToDisk | Add-BEBackupSelection <<<< $x | Save-BEBackupDefinition
+ CategoryInfo : InvalidArgument: (:) [Add-BEBackupSelection], Pa
rameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,BackupExec.Manage
ment.CLI.Commands.AddBEBackupSelectionCommand
Why the bind don't pass ?
I notice that for other selection type (vmware, sql, exchnage etc...) they pass in the "New-BEBackupDefinition" command an option related to the seltion type (like -VMwareSelection , -ExchangeDatabaseSelection or -OracleSeleciton) but no kind of -NDMPselection.
Somethings is missing or I miss somehtings ???
Someone can help me ?
Yann
Solved! Go to Solution.
02-12-2015 11:28 PM
Try this syntax instead:-
$x=New-BENdmpNetAppServerSelection -Volume "/vol/vol1" -Path "/testfolder" -Recurse:$true
New-BEBackupDefinition -BackupJobDefault BackupToDisk | Add-BEBackupSelection -AgentServer NetAppServer -Selection $y | Save-BEBackupDefinition
02-13-2015 02:07 AM
Yes it work now :)
with this correct commande:
$x=New-BENdmpNetAppServerSelection -Volume "/vol/vol1" -Path "/testfolder" -Recurse:$true
New-BEBackupDefinition -BackupJobDefault BackupToDisk | Add-BEBackupSelection -AgentServer NetAppServer -Selection $x | Save-BEBackupDefinition
(the X not the Y, you was right we miss it ;- and with dns name it works no need to use IP)
Can you tell your collegue that they have to correct the help file ?
Anyway thanks for your help, very usefull.
Best Regards
Yann
02-12-2015 05:16 AM
Instead of Get-BEAgentServer, use Get-BENdmpServer
02-12-2015 11:19 PM
:(
Thanks VJware for your answer, but same result:
Add-BEBackupSelection : Cannot bind parameter 'AgentServer'.
02-12-2015 11:28 PM
Try this syntax instead:-
$x=New-BENdmpNetAppServerSelection -Volume "/vol/vol1" -Path "/testfolder" -Recurse:$true
New-BEBackupDefinition -BackupJobDefault BackupToDisk | Add-BEBackupSelection -AgentServer NetAppServer -Selection $y | Save-BEBackupDefinition
02-13-2015 12:27 AM
not working.But answer different.
Add-BEBackupSelection : Cannot bind argument to parameter 'Selection' because i
t is null.
At line:1 char:123
+ New-BEBackupDefinition -BackupJobDefault BackupToDisk | Add-BEBackupSelection
-AgentServer netapp01.prod.local -Selection <<<< $y | Save-BEBackupDefinitio
n
+ CategoryInfo : InvalidData: (:) [Add-BEBackupSelection], Parame
terBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,B
ackupExec.Management.CLI.Commands.AddBEBackupSelectionCommand
02-13-2015 01:04 AM
Does it make any difference if you use the IP address instead of the name, and as such the cmdlet would be:-
$x=New-BENdmpNetAppServerSelection -Volume "/vol/vol1" -Path "/testfolder" -Recurse:$true
New-BEBackupDefinition -BackupJobDefault BackupToDisk | Add-BEBackupSelection -AgentServer 10.10.10.10 -Selection $x | Save-BEBackupDefinition
And in my earlier example, I erred by using "x" in the first line and then using "y" in the second. Have corrected it now to both "x"
02-13-2015 02:07 AM
Yes it work now :)
with this correct commande:
$x=New-BENdmpNetAppServerSelection -Volume "/vol/vol1" -Path "/testfolder" -Recurse:$true
New-BEBackupDefinition -BackupJobDefault BackupToDisk | Add-BEBackupSelection -AgentServer NetAppServer -Selection $x | Save-BEBackupDefinition
(the X not the Y, you was right we miss it ;- and with dns name it works no need to use IP)
Can you tell your collegue that they have to correct the help file ?
Anyway thanks for your help, very usefull.
Best Regards
Yann
02-13-2015 07:10 AM
One more things... ;)
Your solution solve the sechelued job, but what about the OneTimeBackup ?
It is compatible with NDMP ?
I should use the Submit-BEOnetimeBackupJob but this time I also have binding problem....
for example :
Submit-BEOnetimeBackupJob -AgentServer netappsrv01.prod.local -FileSystemSelection "/vol/vol1"
I got :
Submit-BEOnetimeBackupJob : FileSystemSelection is not a valid parameter for th
e specified agent server type.
At line:1 char:26
+ Submit-BEOnetimeBackupJob <<<< -AgentServer netappsrv01.prod.local -FileSystem
Selection "/vol/vol1"
+ CategoryInfo : InvalidArgument: (:) [Submit-BEOnetimeBackupJob]
, InvalidCommandArgumentException
+ FullyQualifiedErrorId : ClientBusinessLogic,BackupExec.Management.CLI.Co
mmands.SubmitBEOnetimeBackupJobCommand
And if I try to :
$x=New-BENdmpNetAppServerSelection -Volume "/vol/vol1" -Path "/testfolder" -Recurse:$true
Submit-BEOnetimeBackupJob -AgentServer netappsrv01.prod.local -FileSystemSelection $x
I got:
Submit-BEOnetimeBackupJob : Cannot bind parameter 'FileSystemSelection'. Cannot
convert the "/*.*" value of type "BackupExec.Management.CLI.BENdmpNetAppServer
Selection" to type "BackupExec.Management.CLI.BEFileSystemSelection".
At line:1 char:81
+ Submit-BEOnetimeBackupJob -AgentServer netappsrv01.prod.local -FileSystemSelect
ion <<<< $x
+ CategoryInfo : InvalidArgument: (:) [Submit-BEOnetimeBackupJob]
, ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,BackupExec.Manage
ment.CLI.Commands.SubmitBEOnetimeBackupJobCommand
02-15-2015 06:56 PM
It should work. Try this instead:-
Submit-BEOnetimeBackupJob -SelectionList (New-BEBackupSelection -AgentServer (Get-BEAgentServer NetAppServer) -Selection (New-BENdmpNetAppServerSelection -Volume "/vol/vol1" -Path "/testfolder" -Recurse:$true))
02-16-2015 11:48 PM
Thanks you VJware, that work fine with the OnetimeBackup command.
Thanks for everythings