Video Screencast Help

Export Backup Selection list via BEMCLI

Created: 15 Sep 2013 • Updated: 24 Sep 2013 | 4 comments
Caroline Kiel's picture
This issue has been solved. See solution.

Is there a chance, to export a (or all) backup selection lists via PowerShell in BE2012?

If I use "get-bejobs", I only get a summary like "<servername> (Partial), C: (Partial), D: (Partial)"

Thank you very much,

Operating Systems:

Comments 4 CommentsJump to latest comment

pkh's picture

Unfortunately, no.  I have not found a way to do so.  There is a switch in BEMCMD that does dump selection details, but BEMCLI has no equivalent function.

You might want to post this as an Idea.

w-d's picture

I confirm that you cannot save the selections, however the backup definition can be exported.

Check this document:

Export Backup Definitions with BEMCLI on BE 2012

Rahul Kumar1's picture

Export a single backup definition:

Get-BEBackupDefinition –name <definition name> |  Export-BEBackupDefinition > c:\<somename>.ps1

To export all definitions to a separate ps1 file:

 $jobs = Get-BEBackupDefinition
 foreach ($job in $jobs)
                 $defname = $
                 $job | Export-BEBackupDefinition > c:\$defname.ps1

Import the backup definition:
<exported-bebackupdefinition.ps1> -AgentServer  <agent server name> | save-BEBackupdefinition

Caroline Kiel's picture

Hi everyone,
I found out, that it is possible by simply querying the database directly:

SELECT t2.[JobName]
FROM [BEDB].[dbo].[vwScriptPropertiesBackup] t1,[BEDB].[dbo].[vwScriptJob] t2
WHERE t1.scriptname = t2.scriptname AND t1.ScriptID <> '10011001-1001-1001-0101-010101010101'
AND t1.ScriptID <> '10011002-1001-1001-0101-010101010101' AND t2.jobname <> 'NULL' AND t1.DeviceSelectionName <> 'NULL'

The results are filtered to drop the default exclusions that BE does automatically.

All the best from over here,

If this post is the answer to your question, please mark it as a solution.

If you can dream it, you can do it. (Walt Disney)