Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Firstly, I can't use Group Policy as our team doesn't manage that. The company is a massive FTSE company with a team for every aspect of IT you can think of.

Our team needs a way of installing programs remotely either by batch files or scripts utlising Windows Installer and .msi files.

I've so far managed to install Java using psexec (see below)

psexec \\pcname -u *username* -p *password* -i 
msiexec.exe /a "msilocation\install.msi"

This works without any problems. However I want something a little more automatic than that.

However what I would like to do is to be able to run a script or batch file from my machine that will install the msi on all remote workstations listed. I'm pretty certain you can list workstations in batch file but I maybe wrong.

I'm not to fussed if I have to do the fix in a script or batch file to be honest. I just can't use Group Policy etc.

share|improve this question
    
"massive FTSE company" with no deployment tools? –  symcbean Jun 15 '11 at 10:01
2  
The corporate domain uses Group Policy, but regional offices like ourselves don't have access to Group Policy and change requests take forever to go through. –  stead1984 Jun 15 '11 at 10:11
    
Then, in addition to bypassing the structures in place, you'll also need to work out how to bypass the software licence auditing tools? –  symcbean Jun 15 '11 at 10:25
    
We are not rolling out licensed products, mearly pluggins and custom software tools. –  stead1984 Jun 15 '11 at 10:47
    
Are you able to use login or machine startup scripts? –  John Gardeniers Jun 15 '11 at 12:01

4 Answers 4

up vote 5 down vote accepted

Create a text file named COMPUTERS.TXT and put all the computer names in it, one per line.

Then, create a .CMD file with the following code:

EDIT

I added %%i\ in front of *username to specify the remote machine admin user.

EDIT 2

I fixed a typo in the code...changed psexec \\%%1 to psexec \\%%i.

@ECHO OFF

FOR /F "tokens=1" %%i IN (COMPUTERS.TXT) DO (
  psexec \\%%i -u %%i\*username* -p *password* -i msiexec.exe /a "msilocation\install.msi"
)
share|improve this answer
    
It doesn't seem to work, I've made the amendments required. I don't get an error message, all the machines are on and on the network. –  stead1984 Jun 16 '11 at 7:31
    
@stead1984 There was a typo in the code. I changed \\%%1 to \\%%i. Try that and see what happens. –  aphoria Jun 16 '11 at 11:32
    
At my previous job I did it this way, for MSI installation and otherwise, for years to do almost everything. I love PsExec. My favorite tool OF ALL TIME on Winboxen! –  ajstein Jun 16 '11 at 13:22
    
@aphonia I've made the changes as said but still nothing. It does look like it runs. –  stead1984 Jun 16 '11 at 13:47
    
@stead1984 Try using notepad.exe or calc.exe as the program to run...that will make it easier to determine where the problem is. –  aphoria Jun 16 '11 at 14:39

if you have admin on the remote devices doesn't psexec have an command line option that uses a text file for input!

share|improve this answer
    
That would be great if I didn't need to specify a local admin password, as none of our domain user accounts have local admin rights. –  stead1984 Jun 15 '11 at 12:16

I created a VB app that I think fits what you're looking for. The application is called Script Zombie. Basically it passes a host name to script to be executed. You can control how many tasks will be spawned concurrently, so you could have your script running against as many as 25 systems at once.

Here's where you can grab the free application: Script Zombie v0.85

share|improve this answer

As you are able to use startup scripts perhaps you can script this so that each machine initiates it from that end, rather than trying to push it out from remote. If necessary the script could start by checking a file on a shared resource which lists the machines that should be involved and exit if it's name is not on the list.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.