AstaaLavista
(Starting to like KiXtart)
2005-12-15 06:58 AM
Installing executables on a remote machine

Hi,

I m writing a script which will install patches on a number of machines. the patches will be kept on a server.
e.g. run \\Machine-Name\Folder-Name\Windows2000-KBXXXXXX-x86-ENU.EXE /s


for this i will have to create a scheduled task on all machines. This task will run kix32.exe (kept on server) for each machine.

Is it possible to have only one single scheduled task kept on the server. this will run the executable individually for each machine.
the problem is that run does not accept arguments for remote execution. i.e. i want to run Executable1 kept on Server1 using the script Kix1 (again on server1) for MACHINE1, something similar to SMS Push.

Thank you.


AstaaLavista
(Starting to like KiXtart)
2005-12-20 06:13 AM
Re: Installing executables on a remote machine

Hi,
It seems to me as if I have asked so dumb a question that nobody wants to answer it or is it that such activity (Installing on remote m/c) is just not possible ?
Please reply.


Richard H.Administrator
(KiX Supporter)
2005-12-20 09:33 AM
Re: Installing executables on a remote machine

Search the board for KSMS - it may do everything you need, and if not it will at least give you some ideas how to get started.

Radimus
(KiX Supporter)
2005-12-20 11:16 AM
Re: Installing executables on a remote machine

also search for RemoteExec. remember the issues of user context when working on remote machines, the local system account doesn't have network access, so you will either have to provide a domain user account with local admin, or push the file to the client pc, and then let a system account install it

NTDOCAdministrator
(KiX Master)
2005-12-20 11:22 AM
Re: Installing executables on a remote machine

Was just going to suggest your UDF Rad.

Dang, 5:20 AM go back to bed, you're not in the Army anymore Rad.


Radimus
(KiX Supporter)
2005-12-20 12:55 PM
Re: Installing executables on a remote machine

naa, my daughter just discovered myspace.com, and 4am is the only time I can get to use my PC

Radimus
(KiX Supporter)
2005-12-20 01:06 PM
Re: Installing executables on a remote machine

actually, I was looking into making a admin level patch install client for people whose users aren't local admin.

basically it would be something like a user app that checks the reg for patches installed vs. patches available in a network share, and then copies the exe to a folder on the PC

then a "service" polls that folder, looks for files, verifies it some way, installs it, and then prompts the user to restart.

It isn't much code to write, ther is really only 3 or 4 elements to it.
* client to check reg and patches (user perms) and copy new one
* client to poll for patches copied to 'special folder' local admin (system acct)
* installer to create service (admin privledges, possibly pushed by admin tool)
* possibly a code section to configure reg keys for variables like source and dest folders, freq of checking, freq of prompts to user for rebooting, etc. (minor details)


AstaaLavista
(Starting to like KiXtart)
2005-12-29 06:11 PM
Re: Installing executables on a remote machine

Hi All,
It really took me some time to atleast know a tip of KSMS. (It's too much for my brain )
I am currently trying Radimus's fnRemoteExec.
[CODE]
$computer = "inf-hw-25941a" ; Remote computer name
$rc = fnRemoteExec('regsvr32 c:\WINNT\KX95.dll /s', $computer)
[/CODE]

The dll is on my local machine in WINNT folder. When i run this script from my local m/c, it gives me unknown failure (8) error.
Am i missing anything?


Radimus
(KiX Supporter)
2005-12-29 06:18 PM
Re: Installing executables on a remote machine

the file needs to be on the remote machine

copy it to the remote PC.
the command that is executed must be as if you were typing it at the remote PC's console


ShawnAdministrator
(KiX Supporter)
2005-12-29 06:20 PM
Re: Installing executables on a remote machine

and dont forget, KX95.dll isn't a DLL you can regsvr32 anyways.

Les
(KiX Master)
2005-12-29 06:30 PM
Re: Installing executables on a remote machine

Quote:

and dont forget, KX95.dll isn't a DLL you can regsvr32 anyways.



...and it certainly must NOT be put on any NT class machine!


AstaaLavista
(Starting to like KiXtart)
2005-12-30 06:35 AM
Re: Installing executables on a remote machine

I tried that too. This time i kept the executable on the remote machine, but it still gave the error 8.
Code:
  
$computer = "itl-hw-22254d" ;Remote machine
$rc = fnRemoteExec('c:\WINNT\yahoo.exe', $computer)

? $rc


One more thing, i m running the script from XP machine, while the remote machine has 2K Pro installed on it.


AstaaLavista
(Starting to like KiXtart)
2005-12-30 06:52 AM
Re: Installing executables on a remote machine

Quote:

the file needs to be on the remote machine

copy it to the remote PC.
the command that is executed must be as if you were typing it at the remote PC's console




If the file is to be copied to the remote m/c then the whole purpose of my script gets defeated. I wanted that the file & the script BOTH should be kept on the Server & should run from there itself.

I am getting a wild idea, using Radimus's fnRemoteExec, is it possible to copy the file on server location to the remote machine & then run the same.


NTDOCAdministrator
(KiX Master)
2005-12-30 08:04 AM
Re: Installing executables on a remote machine

Should be possible. Shawn has also recently released a new RUNNAS utility that might be able to do what you're wanting to do.

Radimus
(KiX Supporter)
2005-12-30 12:24 PM
Re: Installing executables on a remote machine

read the remarks of the RemoteExec() UDF.

The remoteexec process has NO NETWORK PERMISSIONS, it cam only execute local (to the remote machine)

Therefore, you will have to push all the necessary files to the remote PC and then execute with remoteexec


tylan
(Starting to like KiXtart)
2005-12-31 07:47 AM
Re: Installing executables on a remote machine

I noticed that the original post referenced a MS patch. If you are working with security patches it's well worth the effort to set up WSUS on a 2003 server. It's free, and it's a great MS patch management solution.

I do realize that this is a KiX board, but why reinvent the wheel? That is, if there's already a free wheel that does what you need! I apologize if this is way off of what you are looking for...


Radimus
(KiX Supporter)
2005-12-31 07:52 AM
Re: Installing executables on a remote machine

The simplest answer is that you may not be allowed a win2k3 server or management doesn't want WSUS.

I work for a gov't agency and it would take the net admins 3 years of testing before they would attempt it... We still haven't upgraded all the desktops to XP yet... and there are still a few NT servers floating out there.

I'm sure it is great and all, but it isn't all things to all people


tylan
(Starting to like KiXtart)
2005-12-31 02:27 PM
Re: Installing executables on a remote machine

And there is also the ever so slight chance that AstaaLavista has never heard of WSUS. I was just throwing it out there.

I know what you mean about management. When MS was going to discontinue support on SUS so many people complained. I couldn't figure out why when WSUS is clearly superior in every way. Like you pointed out... good old red tape. Who wants change when you have to fill out 'TPS report' after 'TPS report' and explain something technical to non-technical users! All just to install needed security patches.

I do appreciate that you didn't blast me for thinking outside the KiXtart 'box'.


Sealeopard
(KiX Master)
2005-12-31 04:10 PM
Re: Installing executables on a remote machine

KSMS is based on utilizing the Task Scheduler, just take a look at the ScheduleTask() UDF.

AstaaLavista
(Starting to like KiXtart)
2006-01-01 07:49 AM
Re: Installing executables on a remote machine

I agree with Radimus & Tylan.
I hadn't heard about WSUS, but when i have heard about it, i cant use it because the netadmins wont allow me to use it.
so i will have to write a kix script that will do the work for me.


AstaaLavista
(Starting to like KiXtart)
2006-01-01 08:03 AM
Re: Installing executables on a remote machine

Hi All,
It worked, this time i specified the ip address instead of the machine name and i was able to install an executable on the remote m/c (yahoo messenger to be precise )


AstaaLavista
(Starting to like KiXtart)
2006-01-01 08:31 AM
Re: Installing executables on a remote machine

Finally i got almost what i wanted.
Here's the sample script. although i will have to take care of many issues, but the bottleneck has been removed.
Code:
  
$computer = "10.19.20.25" ; ip of the remote computer
$RemotePath = "\\10.19.20.25\C$\TempPath\"
; path of the remote computer where the executable is to copied

Copy "c:\yahoo.exe" $RemotePath /C
;copy the executable from local to remote pc

$rc = fnRemoteExec('c:\TempPath\yahoo.exe', $computer)
;after copying execute it
? $rc