msi remote install script

Well, under the gun as usual. I need to deploy a custom Snare.msi to over 1000 servers. I attempted to utilize McAfee's Herules (utilized for patch deployment and remediation) but kept getting fail errors. Of course our Gold Support contract yeilded NOTHING.
I utilized a PowerScript script but ran into issues with using it on the first batch of 200 servers - the receiving server must have PS installed. Well since i know they all have VB command line interpreter - i would like a VB script to remotely deploy the Snare msi, initialize the service, and then remove the msi, without re-booting the server.
Any help?
Who is Participating?
Steve KnightIT ConsultancyCommented:
If you have a list of the server names, you could use psexec from a batch / cmd file.  Save this as runonall.cmd

It reads a file serverlist.txt, one server per line.  Outputs errors.txt showing any problems and puts any that failed to run completely into the file failed.txt which could be used to try again renamed to serverlist.txt

@echo off
set errors=errors.txt
set failed=failed.txt

for /F %%a in (serverlist.txt) do (
 echo Working on %%a
 xcopy \\server\share\snare.msi \\%%a\c$
 if errorlevel 1 (
   echo Failed to copy for %%a
   echo %%a - Copy failed>>%errors%
   echo %%a >>%failed%
) ELSE (
 psexec \\%%a -i msiexec.exe /i c:\snare.msi
 if errorlevel 1 (
   echo Failed to psexec for %%a
   echo %%a - PSEXEC failed>>%errors%
   echo %%a >>%failed%
I would actually add the -d switch to psexec as well, so that way it hits a server, launches the psexec service and moves on, instead of waiting for the spawned process (msiexec.exe) to comlete the install......

Just a suggestion.....

Nice scripting dragon-it.... :-)
jkmacAuthor Commented:
dragon-it -> thanks for your esxpertiese and time to help me out. I will implement your solution and add johnb6767 suggestion to add the -d switch.
Thanks gents - i will let you know the outcome.
Steve KnightIT ConsultancyCommented:
Good point johnb6767.... or could be quite a long wait while it runs...

Let us know how it goes like you say!

I learned the hard way...  :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.