psexec to execute remote powershell EV cmdlets

Ryujin's picture

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!!!

Ryujin's picture

Powershell V2

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's picture

Hope this is not a stupid

Hope this is not a stupid question, but *why* do you want to execute it remote?

Cheers

NilsV's picture

One reason

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's picture

Does this

Does this help?
http://support.veritas.com/docs/312327

EV Backline Technical Support Engineer
APJ Region

jz81's picture

Hello, I'm not sure why you

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