Using PowerShell cmdlets in backup scripts

Enterprise Vault's backup mode PowerShell cmdlets are designed to be used to control backup mode from within your backup scripts. For example, you can set backup mode on vault stores and index locations before you take a backup, and clear backup mode again after the backup is complete.

This section describes how to use Enterprise Vault's backup mode PowerShell cmdlets in your backup scripts.

Note:

Enterprise Vault and Microsoft Windows PowerShell 1.0 must be installed on your server to run these cmdlets.

In your backup scripts, you can use a single command to:

For example, you can use the following command at the start of your backup script, or in a pre-backup script, to set backup mode before you take a backup. This command runs PowerShell and loads the Enterprise Vault PowerShell snap-in, then runs the set-vaultstorebackupmode cmdlet, to set backup mode on the vault store group called Express Vault Store Group:

powershell -psconsolefile "C:\Program Files\Enterprise Vault\EVShell.psc1" -command "& {set-vaultstorebackupmode -name 'Express Vault Store Group' -evservername EVserver -evobjecttype vaultstoregroup}"

After your backup is complete, you should run a similar command in your script to clear backup mode. For example:

powershell -psconsolefile "C:\Program Files\Enterprise Vault\EVShell.psc1" -command "& {clear-vaultstorebackupmode -name 'Express Vault Store Group' -evservername EVserver -evobjecttype vaultstoregroup}"

On 64-bit Windows operating systems, you must run the Enterprise Vault PowerShell snap-in under the 32-bit version of PowerShell. The 32-bit version of PowerShell is installed in %SystemRoot%\SysWow64\WindowsPowerShell\v1.0.

For example, in your scripts you can call 32-bit PowerShell directly from this path:

%SystemRoot%\SysWow64\WindowsPowerShell\v1.0\powershell -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {set-vaultstorebackupmode -name 'Express Vault Store Group' -evservername EVserver -evobjecttype vaultstoregroup}"

Alternatively, you can set an environment variable that contains the path of the 32-bit version of PowerShell. For example, set an environment variable called ps32 and use it in your scripts:

%ps32%\powershell -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {set-vaultstorebackupmode -name 'Express Vault Store Group' -evservername EVserver -evobjecttype vaultstoregroup}"