cancel
Showing results for 
Search instead for 
Did you mean: 

EV 8 backup mode PowerShell cmdlet's

Nick_Reeves
Level 4
Partner

I did search the forum, and then the web a bit, but i'm having some trouble using the EV8 'cmdlets' to set/clear the backup mode on the site, indexes, etc. my goal is to create pre/post scripts for backing up EV.

 

The commands mentioned in the admin guide work fine when I open the EV command shell, but when i put them into a .psc1 script i cannot execute it, powershell complains.

 

Has anyone created these script files that may be able to assist?

1 ACCEPTED SOLUTION

Accepted Solutions

Faxson
Level 5

You need to tell Powershell to load the EV snapin.  It shoudl then know about the EV specific commandlets.

 

You will have to add the following to your command line:

 

-psconsolefile "C:\Program Files\Enterprise Vault\EVShell.psc1"

 

EG:

 

powershell -psconsolefile "C:\Program Files\Enterprise Vault\EVShell.psc1" backup.psc1

 

there is a reference to this in the readme for EV8.

 

Ben Jackson

..

 

 

View solution in original post

11 REPLIES 11

Paul_Grimshaw
Level 6
Employee Accredited Certified

As you have not provided the script or the error details it is difficult to say but a couple of things I can ask now are:-

 

1. Did you by any chance install powershell after you installed EV? I ask this as Power Shell Cmdlets need to be registered with Windows PowerShell. Window PowerShell is a free download and not bundled with Windows Operation System, so in case where an admin installs PowerShell after EV, then EV PowerShell Cmdlets need to be registered manually

 

2. When you are running the script are you running it as a user that has the relevant rights to run these commands.

 

There also should be some powershell examples in the documentation but I am not in a position currently to look and confirm that.

Nick_Reeves
Level 4
Partner

How can i register the EV cmdlets?

 

PowerShell was installed after EV. As i said they work fine in the EV mamagement console but not when i try to run them as a script :

 

 

C:\>powershell c:\test.ps1
The term 'Get-IndexLocationBackupMode' is not recognized as a cmdlet, function,
 operable program, or script file. Verify the term and try again.
At C:\test.ps1:1 char:28
+ Get-IndexLocationBackupMode  <<<< evsite

Thanks!

Michael_Bilsbor
Level 6
Accredited

Hi,

 

These are example of how the syntax should be

 

et-indexlocationbackupmode -evservername server1get-indexlocationbackupmode -evservername server1 -evsitename "demo site"get-indexlocationbackupmode -evservername server1 -indexrootpath "g:\Indexes\location1"

 

 

Nick_Reeves
Level 4
Partner

Yep, you're right! And they all work great when I run them in the Enterprise Vault Management Shell.

 

However, We cannot run these commands manually before/after every backup is done of EV. Can you provide examples of how this would look in script we could run from Netbackup as part of a pre/post backup job?

 

When I put these working commands into a powershell script and try to execute them, that's when I'm out of luck.

 

C:\>powershell c:\test.ps1
The term 'Get-IndexLocationBackupMode' is not recognized as a cmdlet, function,
 operable program, or script file. Verify the term and try again.
At C:\test.ps1:1 char:28
+ Get-IndexLocationBackupMode  <<<< evsite

 

the file test.ps1 contains ONLY "Get-IndexLocationBackupMode evsite" in it for testing. This command works just fine when i type it into the shell and execute it.

 

 

Message Edited by Nick Reeves on 01-09-2009 04:06 PM

Michael_Bilsbor
Level 6
Accredited
are you specifying -evsitename   (that is an actual parameter and not a value)

Sortid
Level 6

I haven't installed EV8 yet, but it looks similar to Exchange 2007 powershell windows. Could it be that you are running the script from the wrong location?  If you use powershell as installed by windows, it will not know about commands from EV.  You may need to call the EV powershell instance, then run the script from there.

Sortid
Level 6

I should clarify, when you call EV powershell, it may call powershell with an EV shell.  Check thepath on the EV powershell shortcut, it should show you the syntax to call the shell.

AndrewB
Moderator
Moderator
Partner    VIP    Accredited
I think you would have to start your script with Add-PSSnapin <EV8 Snapin Name> for it to load the new EV cmdlets into the shell.

Nick_Reeves
Level 4
Partner

The command i'm testing in the script does work in the EV management shell and the normal powershell (i just open cmd prompt and type 'powershell').

 

I believe i'm just not building my script correctly.

Faxson
Level 5

You need to tell Powershell to load the EV snapin.  It shoudl then know about the EV specific commandlets.

 

You will have to add the following to your command line:

 

-psconsolefile "C:\Program Files\Enterprise Vault\EVShell.psc1"

 

EG:

 

powershell -psconsolefile "C:\Program Files\Enterprise Vault\EVShell.psc1" backup.psc1

 

there is a reference to this in the readme for EV8.

 

Ben Jackson

..

 

 

Nick_Reeves
Level 4
Partner

Thank you Faxson! I did overlook this in the ReadMe, hopefully the documentation will have similar examples at some point.

 

This is exactly what I needed.