cancel
Showing results for 
Search instead for 
Did you mean: 

BE2014 + NDMP + Powershell

ylo
Level 3
Partner Accredited

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

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

VJware
Level 6
Employee Accredited Certified

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

 

View solution in original post

ylo
Level 3
Partner Accredited

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

View solution in original post

9 REPLIES 9

VJware
Level 6
Employee Accredited Certified

Instead of Get-BEAgentServer, use Get-BENdmpServer

ylo
Level 3
Partner Accredited

:(

Thanks VJware for your answer, but same result:

 

Add-BEBackupSelection : Cannot bind parameter 'AgentServer'.

 

VJware
Level 6
Employee Accredited Certified

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

 

ylo
Level 3
Partner Accredited

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

VJware
Level 6
Employee Accredited Certified

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"

ylo
Level 3
Partner Accredited

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

ylo
Level 3
Partner Accredited

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

 

 

 

VJware
Level 6
Employee Accredited Certified

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))

ylo
Level 3
Partner Accredited

Thanks you VJware, that work fine with the OnetimeBackup command.

 

Thanks for everythings