Video Screencast Help


Created: 06 Sep 2012 | 10 comments


I have PS, and can run the BEMCLI.

I can create a VM (VMware) using a backup set from BE Wizard. So, I am trying to match the parameters to do the same using a BEMCLI.

The help syntax for "Submit-BEConvertBackupToVirtualJob" is confusing.

Submit-BEConvertBackupToVirtualJob -JobHistory [<BEJobHistory>] -TargetEnvironment [<BEConvertToVirtualTargetEnvironment>] [-AutomaticallyDeleteJob {Never | IfSuccessful | WhenComplete}] [-Priority {Normal | Lowest | Low | High | Highest}] [-StartDate [<DateTime>]] [-SubmitOnHold [<Boolean>]] [-ExcludeNonSystemData [<SwitchParameter>]] [-VirtualMachineName [<String>]] [-Name [<String>]] [-VirtualMachineCpuCount [<UInt32>]] [-VirtualMachinePhysicalRamMB [<UInt32>]] [-OverwriteExistingVirtualMachine [<Boolean>]] [-Confirm
[<SwitchParameter>]] [-WhatIf [<SwitchParameter>]] [<CommonParameters>]

When I go step-by-step, not sure how to progress.

BEMCLI > Submit-BEConvertBackupToVirtualJob

What value for TargetEnvironment to set?

I'd like to see if anyone can share some good examples with explanations on how to get the values for the parameters before running the script.

Thanks a lot

Comments 10 CommentsJump to latest comment

pkh's picture

Take a look at the BEMCLI documentation and under each cmdlet you can see samples of how the cmdlet is used.  For example, for the BEConvertBackupToVirtualJob cmdlet

C:\PS> $targetEnvironment = New-BEConvertToVirtualTargetEnvironment -HyperVServerName hypervserver01 -HyperVDestinationPath c:\vms -LogonAccount "System Logon Account" -ToolsIsoPath c:\hypervtools.iso
C:\PS> Get-BEJob "Job 0001" | Get-BEJobHistory -FromLastJobRun | Submit-BEConvertBackupToVirtualJob -FileSystemSelection C:\BackedUpData\*.*

These commands create a virtual machine on a Hyper-V server using data from the most recent run of a job named "Job 0001".

If you need other samples of how BEMCLI, see my other articles/downloads

tisso's picture

Dear pkh,

Thanks for the links.

Is BEMCLI an official supported tool (i.e. if we configure a scritp to run it, and there is an issue, can we call Support?".

Or, is it just an admin tool?


pkh's picture

BEMCLI is a part of BE 2012 so it is supported.  However, you got to be careful when your script fails.  If your script has 10 PS cmdlets and 1 BEMCLI cmdlet, you got to make sure that it is the failure of the BEMCLI cmdlet before you can call Support.  If the other PS cmdlets fails or are not used properly, or the BEMCLI cmdlet fails because parameters are not passed correctly to if from the other cmdlets, then obviously Symantec is not responsible.

tisso's picture


If anyone can tell me how and what value to set for "TargetEnvironment", I would appreciate.Thanks.

pkh's picture

If you are refering to the example above, it is the various parameters to define the VM host that you are converting the backup to.  You got to put in the actual parameters for your environment, e.g. the name of the VM host.

tisso's picture

ESX host is ""

In hosts file: edited the IP both as "AB-esx1" and "". Both names ping-able.

The errors:

Cannot bind parameter 'TargetEnvironment'. Cannot convert the "AB-esx1" value of type "System.String" to type "BackupExec.Management.CLI.BEConvertToVirtualTargetEnvironment"


pkh's picture

Copy and paste the actual command that you use and the response.

Have you done a convert to virtual using his VM host with the GUI? If not, you should do so before you try using BEMCLI.  You should also use the name of the VM host as it is known to BE.

tisso's picture

Errors: (same error with host or IP name)

BEMCLI> Submit-BEConvertBackupToVirtualJob
cmdlet Submit-BEConvertBackupToVirtualJob at command pipeline position 1
Supply values for the following parameters:
AgentServer: nbu-client2
Submit-BEConvertBackupToVirtualJob : Cannot bind parameter 'TargetEnvironment'.
 Cannot convert the "" value of type "System.String" to type "Backup
At line:1 char:35
+ Submit-BEConvertBackupToVirtualJob <<<<
    + CategoryInfo          : InvalidArgument: (:) [Submit-BEConvertBackupToVi
   rtualJob], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,BackupExec.Manage

Yes, I have successfully converted using GUI BE and these are the values I used:

Physical server name = nbu-client2

ESX Server = (test-esxi2)

VM name = VM_nbu-client2


pkh's picture

You cannot just enter Submit-BEConvertBackupToVirtualJob.  It will not work.  Take a look at the example referenced above and see what needs to be fed into this cmdlet to get it to work.

Russell Norton's picture

The example used in the BEMCLI documenation is not 100% accrate. There is no FIlesystemSelection for  Submit-BEConvertBackupToVirtualJob and it dose not tell you where to use the $targetEnvironment.

Here is an example  for vmware

BEMCLI> $targetEnvironment = New-BEConvertToVirtualTargetEnvironment -VMwareVCenterServerName <vcentername> -VMwareHostName <hostname> -VMwareDataStoreName <datastore> -LogonAccount <login account> -ToolsIsoPath <path to vmware tools iso>

To run the convertion

BEMCLI>Get-BEAgentServer <server you want to convert> | Get-BEJobHistory -FromLastJobRun  Submit-BEConvertBackupToVirtualJob  -TargetEnvironment $targetEnvironment

NOTE:Commands are all on one line

There are many options for the target enviroment and convertion job cmdlets.

I would suggest refering to the full help documentaion for each cmdlet

get-help  New-BEConvertToVirtualTargetEnvironment -full

get-help  Submit-BEConvertBackupToVirtualJob  -full