Creating the Enterprise Vault backup scripts

In most cases I see people re-using the backupscripts they once created for another customer. Not a lot of people are aware there is a powershell script available in the installation directory of Enterprise Vault that will do the task for you.

In the Templates directory in the Enterprise Vault installation directory (in my case E:\Program Files (x86)\Enterprise Vault\Reports\Templates\) you can find a script which is called Transform-Backup.ps1.

This script will poll the registry to verify the installation path of Enterprise Vault, the VaultStoreGroups, VaultStores and Index Locations.

Before running the script, make sure you change the ExecutionPolicy of the server to allow the script to be ran. I modified mine as “RemoteSigned“. The definition of RemoteSigned is as follows “Downloaded scripts must be signed by a trusted publisher before they can be run.

There is no need to specify any parameters when you execute the script, these will be collected by itself. Easy isn’t it?

Executing the script: “PS E:\Program Files (x86)\Enterprise Vault\Reports\Templates> .\Transform-Backup.ps1″. Once executed a webbrowser will open, with a set of scripts that can be used to create the required pré- & post scripts.

Result:

EV backup mode commands
“Set” and “clear” commands

This page lists commands you can use in your environment to set and clear backup mode using PowerShell cmdlets. The exact set of commands you use depends on your backup methods. The raw data for these commands is drawn from your Enterprise Vault directory database.

Note. You must run these commands using the 32-bit PowerShell.exe because the Enterprise Vault PowerShell Snapin is not registered for use with 64-bit PowerShell. You must either run these commands in a 32-bit DOS environment, or provide the fully-qualified path to the 32-bit PowerShell.exe. For more information see http://entsupport.symantec.com/docs/335865.

Site: Enterprise Vault Site Name
Set backup mode on site

powershell -psconsolefile “E:\Program Files (x86)\Enterprise Vault\EVShell.psc1″ -command “& {Set-VaultStoreBackupMode -Name ‘Enterprise Vault Site Name’ -EVServerName archive -EVObjectType Site}”

Clear backup mode from site
powershell -psconsolefile “E:\Program Files (x86)\Enterprise Vault\EVShell.psc1″ -command “& {Clear-VaultStoreBackupMode -Name ‘Enterprise Vault Site Name’ -EVServerName archive -EVObjectType Site}”

VaultStoreGroup: VaultStoreGroup1
Set backup mode on vault store group
powershell -psconsolefile “E:\Program Files (x86)\Enterprise Vault\EVShell.psc1″ -command “& {Set-VaultStoreBackupMode -Name VaultStoreGroup1 -EVServerName archive -EVObjectType VaultStoreGroup}”

Clear backup mode from vault store group
powershell -psconsolefile “E:\Program Files (x86)\Enterprise Vault\EVShell.psc1″ -command “& {Clear-VaultStoreBackupMode -Name VaultStoreGroup1 -EVServerName archive -EVObjectType VaultStoreGroup}”

VaultStore: ExchangeStore
Set backup mode on vault store
powershell -psconsolefile “E:\Program Files (x86)\Enterprise Vault\EVShell.psc1″ -command “& {Set-VaultStoreBackupMode -Name ExchangeStore -EVServerName archive -EVObjectType VaultStore}”

Clear backup mode from vault store
powershell -psconsolefile “E:\Program Files (x86)\Enterprise Vault\EVShell.psc1″ -command “& {Clear-VaultStoreBackupMode -Name ExchangeStore -EVServerName archive -EVObjectType VaultStore}”

SiteIndexLocations: Enterprise Vault Site Name
Set backup mode on indexes in site
powershell -psconsolefile “E:\Program Files (x86)\Enterprise Vault\EVShell.psc1″ -command “& {Set-IndexLocationBackupMode -EVServerName archive -EVSiteName ‘Enterprise Vault Site Name’}”
Clear backup mode from indexes in site
powershell -psconsolefile “E:\Program Files (x86)\Enterprise Vault\EVShell.psc1″ -command “& {Clear-IndexLocationBackupMode -EVServerName archive -EVSiteName ‘Enterprise Vault Site Name’}”

Please note the script needs to be executed in a PowerShell 32-bit environment. The exe can be found in the following location: “C:\Windows\syswow64\Windowspowershell\v1.0\powershell.exe”.

Happy configuring!

R.

Leave a Reply