cancel
Showing results for 
Search instead for 
Did you mean: 

psexec to execute remote powershell EV cmdlets

Ryujin
Level 3
Partner
Does anyone have experience invoking the EV powershell cmdlets on a remote server via psexec?

A command such as the following will work without problems:
psexec \\evserver cmd /c "echo . | powershell  -psconsolefile ^"C:\Program Files\Enterprise Vault\EVShell.psc1^"  get-command -pssnapin symantec.enterprisevault.powershell.snapin"
Loading the pconsolefile to invoke an EV cmdlet does not work. So what I am trying to do is of the following format:
psexec \\evserver cmd /c "echo . | powershell -psconsolefile "C:\Program Files\Enterprise Vault\EVShell.psc1" -command  "&  {Get-IndexLocationBackUpMode EV8}""
I have used innumerable permutations of escape characters: carat, double quote, single quote, etc. to try to find the magic combination. Invariably an error message resembling the following comes back:
'{Get-IndexLocationBackUpMode' is not recognized as an internal or external command, operable program or batch file. cmd exited on ev with error code 1.
It seems to have problems passing the ampersand to the remote server. It would be nice to have the EV8 snapin permanently registered so I don't need to load the psc1 file.

BTW, I have verified the state described in Symantec support document 319181. So the registry reflects the snapin.

Thoughs? Experience?

Thank you!!!

5 REPLIES 5

Ryujin
Level 3
Partner
BTW, I am fully aware PowerShell V2 supports remoting. However, these are Windows 2003 servers, not 2008, so those functions are not available...

Microsoft has discussed the limitations here.


MichelZ
Level 6
Partner Accredited Certified
Hope this is not a stupid question, but *why* do you want to execute it remote?

Cheers

cloudficient - EV Migration, creators of EVComplete.

NilsV
Level 3
Partner
One reason I can think of is when you have multiple servers running EV, and want a consistent back-up.

Not all back-up applications can coordinate a backup of filesystems and sql, so you would need to quiesce EV when you begin *anything* and resume when you have backed-up *everything*

Paul_Grimshaw
Level 6
Employee Accredited Certified

jz81
Not applicable
Partner
Hello,

I'm not sure why you are using the ampersand and curly braces (to invoke a script-block containing only one command).

I think this should work ...

psexec \\evserver cmd /c "echo . | powershell -psconsolefile "C:\Program Files\Enterprise Vault\EVShell.psc1" -command  "Get-IndexLocationBackUpMode EV8""

Alternatively the following should also work (if you have a script-block containing more than one command) ...

psexec \\evserver cmd /c "echo . | powershell -psconsolefile "C:\Program Files\Enterprise Vault\EVShell.psc1" -command  "invoke-expression 'Get-IndexLocationBackUpMode EV8'""

or

psexec \\evserver powershell -psconsolefile "C:\Program Files\Enterprise Vault\EVShell.psc1" -command  "Get-IndexLocationBackUpMode EV8"

Is this working for you?
Best regards,

John