cancel
Showing results for 
Search instead for 
Did you mean: 

[PowerShell] How to use new commands introduced in EV 11

Shinichi_Hayash
Not applicable
Employee

In Enterprise Vault 11.0, there are many PowerShell commands introduced.

This is an introduction to how to get started.

  1. Start  “Enterprise Vault Management Shell”20141015_185123.jpg
  2. By default, new commands introduced in EV 11 will result in an error.20141015_185149.jpg
  3. You have to manually load these 4 modules .
    Symantec.EnterpriseVault.PowerShell.AdminAPI.dll
    Symantec.EnterpriseVault.PowerShell.Core.dll
    Symantec.EnterpriseVault.PowerShell.IMAP.dll
    Symantec.EnterpriseVault.PowerShell.Monitoring.dll
    
    This is an easy to import them and confirm they are loaded by Get-module command.
    PS> Get-ChildItem -Filter *PowerShell*dll | %{ Import-Module $_.FullName} 
    PS> (Get-Module).Name
    
    20141015_190433.jpg
  4. Next, you want to know what kind of commands are available.
    You can go to the document here   or you can list them by Get-Command.
    PS> get-command -Module Symantec.EnterpriseVault.PowerShell* |Sort-Object ModuleName |ft -AutoSize
    
    20141015_191023.jpg
  5. To understand the usage of each commands, you can reference the document or do get-help.20141015_191221.jpg
  6. Since this is PowerShell , little formatting like the following makes the output nice.
    PS> Get-EVTask |%{ [pscustomobject]@{State=(Get-EVTaskState $_.EntryID);Name=$_.name;}}|ft -auto
    
    20141015_191529.jpg

 

To automate the Import you can create "Microsoft.PowerShell_profile.ps1" file in "C:\Users\vaultadmin\Documents\WindowsPowerShell\" folder and write the Import-Module commands.

C:\Users\vaultadmin\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

Import-Module "C:\Program Files (x86)\Enterprise Vault\Symantec.EnterpriseVault.PowerShell.AdminAPI.dll"
Import-Module "C:\Program Files (x86)\Enterprise Vault\Symantec.EnterpriseVault.PowerShell.Core.dll"
Import-Module "C:\Program Files (x86)\Enterprise Vault\Symantec.EnterpriseVault.PowerShell.IMAP.dll"
Import-Module "C:\Program Files (x86)\Enterprise Vault\Symantec.EnterpriseVault.PowerShell.Monitoring.dll"

To run the Micorosft.PowerShell_profile.ps1 script,  Excecution Policy has to be changed.

PS> Set-ExecutionPolicy RemoteSigned