#162287 - 2006-05-26 03:46 PM
Re: Executing batch files on remote client
|
JazzM
Getting the hang of it
Registered: 2004-04-23
Posts: 91
|
Yes of course it will work, if you run it on manually on remote machine….
I’m using RemoteExec to execute it remotely on a remote client.
Rad comment is: “If you are passing a name and password, it can have access to network resources; otherwise the resources must be local.”
So Im trying to find how to execute it using remoteexec() on remote client
|
Top
|
|
|
|
#162289 - 2006-05-26 04:30 PM
Re: Executing batch files on remote client
|
JazzM
Getting the hang of it
Registered: 2004-04-23
Posts: 91
|
No error! Returned 0
Code:
$computer = "172.60.10.10" $User = "domain\clientadm" $Passwd = "silentadm"
$rc = fnRemoteExec('MsiExec.exe /i \\Appserv\StandardApps\Acdsee\Acdess.msi /quiet', $computer, $User, $Passwd)
? $rc
Function fnRemoteExec($sCommand,Optional $sComputer,Optional $sUser,Optional $sPwd) Dim $objLocator,$objSvc,$objSet $objLocator = CreateObject("WbemScripting.SwbemLocator") $objSvc = IIf($sComputer='',$objLocator.ConnectServer(),$objLocator.ConnectServer($sComputer,,$sUser,$sPwd)) If @ERROR Exit @ERROR EndIf $objSet = $objSvc.Get("Win32_Process") If @ERROR Exit @ERROR EndIf $fnRemoteExec = $objSet.Create($sCommand) Exit @ERROR EndFunction
|
Top
|
|
|
|
#162290 - 2006-05-26 05:03 PM
Re: Executing batch files on remote client
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I played hell trying to get it to access network resources remotely... and I couldn't get much love at all.
Therefore I push the files to remote machine and execute it 'local' on the remote PC
|
Top
|
|
|
|
#162291 - 2006-05-26 05:27 PM
Re: Executing batch files on remote client
|
JazzM
Getting the hang of it
Registered: 2004-04-23
Posts: 91
|
Ok, then not much love for me either … 
So the result success conditions using RemoteExec() udf depends on:
- Commands which can be used in Silent, and None-Interactive mode. - Commands that NOT requires or calls for network resources.
Until Windows truns to Unix!
|
Top
|
|
|
|
#162298 - 2006-05-27 02:46 AM
Re: Executing batch files on remote client
|
JazzM
Getting the hang of it
Registered: 2004-04-23
Posts: 91
|
Gotta admit with Doc... in this particular case, Im more then willing to take the chance ...
So lets do it. How can Shawn's RUNNAS help me. I want to execute this remotly on a remote client (using RemoteExec() udf).
MsiExec.exe /i \\Appserv\StandardApps\Acdsee\Acdess.msi /quiet
Where do I get Shawn's RUNNAS? What is tokenized script?
|
Top
|
|
|
|
#162301 - 2006-05-27 03:04 AM
Re: Executing batch files on remote client
|
JazzM
Getting the hang of it
Registered: 2004-04-23
Posts: 91
|
I find the RUNNAS... reading the conversations... Seems that dear Les is into security even there...
Well I don’t need the RUNNAS the whole kix… I just need RUNNAS for this part of the script… But first I would like to understand what I’m doing, before doing… could be a good idea… hehehe
|
Top
|
|
|
|
#162302 - 2006-05-27 03:10 AM
Re: Executing batch files on remote client
|
JazzM
Getting the hang of it
Registered: 2004-04-23
Posts: 91
|
Ey don’t get me wrong ... Its good to have security brains around which could time to time remind us about the real world around...
But just for this particular case, I found the risk very low in the environment it will be used...
If dear Shawn has done a cool RUNNAS, then I certainly will test that instead of PSExec...
|
Top
|
|
|
|
#162303 - 2006-05-27 03:43 AM
Re: Executing batch files on remote client
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11625
Loc: CA
|
Quote:
Me, myself and I... all three of us monitor all traffic on the WAN pipe.
Okay, sure you do Les. It's like a needle in a haystack. If you have 1,000 machines plus servers and you think you can monitor the Gigabytes of traffic to that level then I think you've just elevated yourself to a GOD like status.
Sorry, but unless you wrote a for purpose monitor and knew when this was going to happen it's just impossible to know when a remote call is valid or not and what it's doing.
The point here is that Jazz and ONLY Jazz knows he is doing it and when he is doing it. It's not like another Admin or user has a sniffer or protocol analyzer running specifically looking for a packet that contains RUNNAS. Just not realistic for anyone to perform such a task out of the blue without prior knowledge.
|
Top
|
|
|
|
#162304 - 2006-05-29 11:28 AM
Re: Executing batch files on remote client
|
JazzM
Getting the hang of it
Registered: 2004-04-23
Posts: 91
|
ehhh... 
Why is Shawn suddenly surrounded by monsters, losing his hat!!! And Doc… look suspicious… smells Linux at the corner … Is this because Les is monitoring the Wan …
|
Top
|
|
|
|
#162305 - 2006-05-29 02:27 PM
Re: Executing batch files on remote client
|
JazzM
Getting the hang of it
Registered: 2004-04-23
Posts: 91
|
… ok dudes … back to the subject, if you don’t mind…
Now I’m completely lost…. Don’t really know how to use remoteexec() and RUNNAS together ….
Doc suggested to “Pushing a tokenized script and batch file with Shawn's RUNNAS…” I tired and done some tests.. no success so far… getting dizzy on this… Could some give me a hand to solve this?
The subject is still to remotely execute this: “MsiExec.exe /i \\Appserv\StandardApps\Acdsee\Acdess.msi /quiet” - on a remote client using both remoteexec() udf and Shawn’s RUNNAS.
The “msi.bat” contains this: “MsiExec.exe /i \\Appserv\StandardApps\Acdsee\Acdess.msi /quiet”
$computer = "172.60.10.10" $RemotePath = “\\172.60.10.10\c$\winnt\temp\”
Copy "msi.bat" $RemotePath /C
$rc = RemoteExec('cmd /c c:\Winnt\Temp\msi.bat', $computer)
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 202 anonymous users online.
|
|
|