Page 3 of 3 <123
Topic Options
#162306 - 2006-05-29 02:50 PM Re: Executing batch files on remote client
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
While it goes against my principles, I will offer some suggestions.
Don't use a BATch file!
You need to create a token file for RUNNAS.
Copy both RUNNAS and the generated token file to the local PC.
RemoteExec RUNNAS and pass the tokenfile as a parm.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#162307 - 2006-05-29 02:59 PM Re: Executing batch files on remote client
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Ja, I was just just going to pipe-up here as well. Copy the RUNNAS.exe to the remote machine, but I would suggest you leave the tokenization as a last step - get it working with a simple command-line first.
Top
#162308 - 2006-05-29 03:03 PM Re: Executing batch files on remote client
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
by the way - accessing the remote share using the "pure" remote command strategies (like WMI) does not work - we went down that road before (not sure where the thread is) ...

One of the guys we were working with at the time, went to MS with the issue. They came back saying that Windows does not support "passthrough authentication" - which means, a network resource will not trust the credentials from a source that is (really) remoted in from somewhere else. Maybe a bad description but I hope you get my meaning.

Top
#162309 - 2006-05-29 04:31 PM Re: Executing batch files on remote client
JazzM Offline
Getting the hang of it

Registered: 2004-04-23
Posts: 91
Ok, let’s see if I got your point….

First I created a tok file as this:

runnas /user:domain\clientadm "MsiExec.exe /i \\Appserv\StandardApps\Acdsee\Acdess.msi /quiet" /password:silentadm /tok:Test.tok /allowargs

Now I have Test.tok. I copied both Runnas.exe and Test.tok to target PC root.
Then I execute it with RemoteExec()

$rc = RemoteExec('cmd /c c:\Runnas.exe Test.tok’, $computer)

Should this work? It doesn’t.

I tried to perform it manually on target PC console:
c:\Runnas.exe Test.tok

It’s not working!

What I’m doing wrong?

Top
#162310 - 2006-05-29 04:40 PM Re: Executing batch files on remote client
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
After you run it by hand, if you ECHO %ERRORLEVEL%, whats it say ?
Top
#162311 - 2006-05-29 05:07 PM Re: Executing batch files on remote client
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
If not using %comspec% /c, might want to add the /wait switch too.
Top
#162312 - 2006-05-29 05:09 PM Re: Executing batch files on remote client
JazzM Offline
Getting the hang of it

Registered: 2004-04-23
Posts: 91
it say: 0

The Runnas I got i version 1.14.0.0
Environment W2K SP4

Top
#162313 - 2006-05-29 05:10 PM Re: Executing batch files on remote client
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Try that /wait switch
Top
#162314 - 2006-05-29 05:26 PM Re: Executing batch files on remote client
JazzM Offline
Getting the hang of it

Registered: 2004-04-23
Posts: 91
humm... same ... not working...

I put the wait switch like this:

runnas /user:domain\clientadm "MsiExec.exe /i \\Appserv\StandardApps\Acdsee\Acdess.msi /quiet" /password:silentadm /tok:Test.tok /wait /allowargs

the msi reports in event viewer, says Product Acdsee - installation operation completed succesfully.... the %ERRORLEVEL% gives a 0

...and still no Acdess has been installed....

Top
#162315 - 2006-05-29 05:29 PM Re: Executing batch files on remote client
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
What happens if you mangle the path to the msi - does it report a failure ?
Top
#162316 - 2006-05-29 05:30 PM Re: Executing batch files on remote client
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I would try the old %comspec% /c in front of the msiexe.exe too.
Top
#162317 - 2006-05-29 05:41 PM Re: Executing batch files on remote client
JazzM Offline
Getting the hang of it

Registered: 2004-04-23
Posts: 91
path to the msi ... %comspec% /c in front of the msiexe.exe ... all the same ... just wont working...

runnas /user:domain\clientadm "%comspec% /c c:\winnt\system32\MsiExec.exe /i \\Appserv\StandardApps\Acdsee\Acdess.msi /quiet" /password:silentadm /tok:Test.tok /wait /allowargs

Top
#162318 - 2006-05-29 06:26 PM Re: Executing batch files on remote client
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Take this off:

/tok:Test.tok

Top
#162319 - 2006-05-30 11:45 AM Re: Executing batch files on remote client
JazzM Offline
Getting the hang of it

Registered: 2004-04-23
Posts: 91
nop... none of this works .... jazz will give this up for now ...
not much fun out of this ...

Top
#162320 - 2006-05-30 09:30 PM Re: Executing batch files on remote client
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Quote:

not much fun out of this ...




ROFLMAO

Yes, scripting can be both FUN and FRUSTRATING at the same time.

Top
Page 3 of 3 <123


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.182 seconds in which 0.137 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org