VMware Cloud Community
Timothy1
Contributor
Contributor

PSexec via SRM

Hi all,

on my srm server I am executing the following command as a post power on script

c:\windows\system32\cmd.exe /c c:\contentchange\drcontent.bat

on the srm server i have script drcontent which contains

@ech off

c:\contentchange\psexec -i -s /accepteula
10.0.1.62 -u administrator -p password c:\scripts\dr.bat

exit 0

I extractes psexec in the contentchange directory ofcourse

The script finnishes but it is not executed on the virtual machine

When I check the logs I see the following

Success: "

PsExec v1.98 - Execute processes remotely

Copyright (C) 2001-2010 Mark Russinovich

Sysinternals - www.sysinternals.com

The handle is invalid.

Connecting to 10.0.1.62...

Couldn't access 10.0.1.62:

Connecting to 10.0.1.62...

If I run the script manually while the test plan runs, it executes succesfully. I have tried a million things (I even gave the everyone user full access to the directory,psexec and the script but nothing works

Anyone?

0 Kudos
6 Replies
admin
Immortal
Immortal

Are you changing IP addresses on the VM? Is it possible that the script is trying to connect before the IP address changes? Are you adding two backslashes before the vm IP (
10.0.1.62)? You are passing credentials and also passing "-s" to run as system account, tried removing -s?

Have you looked into using PowerCLI on the SRM server to invoke the script you are trying to call on the recovery VM? You can use the invoke-vmscript cmdlet and avoid network connectivity issues. Of course you will need to load powershell and powercli on the SRM server.

My problem with using tools like psexec was that I wanted to avoid being dependant on network connectivity during the recovery process and powercli fixed that for me.

0 Kudos
Timothy1
Contributor
Contributor

i did the backslashes. I'm not sure anymore that i tried without the -s but I'm trying it now

0 Kudos
Timothy1
Contributor
Contributor

removing the -s does not help

0 Kudos
mal_michael
Commander
Commander

Try to remove the "-i" (interactive mode) switch.

0 Kudos
Timothy1
Contributor
Contributor

tried it is as well, didn't work Smiley Sad . Thanks anyways guys

0 Kudos
vKiller
Contributor
Contributor

Not sure though. Can you try "c:
scripts
dr.bat" instead of "c:\scripts\dr.bat". Sometimes Path issues occurs even though permission granted.

0 Kudos