Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Running an MSI file on a remote machine

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 20-06-2006
brock_griffin@hotmail.com
 
Posts: n/a
Running an MSI file on a remote machine

I have a script that checks remote computers for the latest update for
a software package. If the update is not on the computer, I want the
script to record the comptuer name to a file, and then copy a MSI file
to the computer, then execute that MSI file in quiet mode. I'm having
trouble because every time the script runs, it reinstalls the update on
my local machine and not the remote machine. Pertinent part of the
script is as follows:

Else

Myfile =
"\\ServerShare\ProgramFolder\Upgraded.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set textstream = fso.OpenTextFile(myFile, 8, True)
Textstream.WriteLine("**********************")
Textstream.WriteLine("ComputerName: " &
strComputer)
Textstream.Close
src = "\\ServerShare\ProgramFolder\File.msi"
dest = "\\"& strComputer
&"\C$\VViewer2003.msi"
fso.copyfile src, dest, true
Set objShell =
CreateObject("WScript.Shell")
cmd = "cmd /c psexec C:\VViewer2003.msi"
objShell.Run cmd, 1, True

Any help would be greatly appriciated!

Reply With Quote
  #2  
Old 21-06-2006
Umesh Thakur
 
Posts: n/a
RE: Running an MSI file on a remote machine

Here is a Microsoft Article on how to install MSI packages remotely on remote
computers. It also includes a sample example code:
http://www.microsoft.com/technet/scr....mspx?mfr=true
Reply With Quote
  #3  
Old 21-06-2006
brock_griffin@hotmail.com
 
Posts: n/a
Re: Running an MSI file on a remote machine

That helped tremendously, but for some reason, I can't get it to
install unless someone with administrative rights is logged in. How
can I set the impersonation level to administrative mode, or is there a
way to supply a domain administrative username and password to do the
install?

Keep in mind I'm very new and very green yet at scripting.
Reply With Quote
  #4  
Old 22-06-2006
Umesh Thakur
 
Posts: n/a
Re: Running an MSI file on a remote machine

Here is the script modified to run under alternate credentials...

'------------------------------------
strComputer = "test-pc"
strUser = "Admin user Name"
strPassword = "Admin password" ' you may want to read value of password
rather than hardcoding it.

'like, use this to read admin user's password:
Set objPassword = CreateObject("ScriptPW.Password")
Wscript.StdOut.Write "Please enter your password:"
strPassword = objPassword.GetPassword()

strDomain = "your domain"

Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer,
"root\cimv2", strUser, strPassword, "MS_409", "ntlmdomain:" + strDomain)

Set objSoftware = objSWbemServices.Get("Win32_Product")
errReturn = objSoftware.Install("c:\scripts\database.msi",,True)
Wscript.Echo errReturn
'-------------------------------------
--
Reply With Quote
  #5  
Old 24-06-2006
Tim
 
Posts: n/a
Re: Running an MSI file on a remote machine

Should this script work if the program to be installed is located on a
computer other than the one where you are trying to do the install?

I tried your script and I can only seem to get it to work when the
program is copied to the remote PC. I am trying to install from a UNC
path on a remote server but am getting back Error 1619.

The article from MS says that this should be possible if you enable
delegation which I have done, but still seem to get the same response.
Reply With Quote
  #6  
Old 26-06-2006
brock_griffin@hotmail.com
 
Posts: n/a
Thank you so much Umesh. You have been truely invaluable to me! This
has been frustrating but fun at the same time, and with your help, you
have saved me days of work!

When running the install on remote machines, I get install error 1639.
Is this related to log in information through the script? I can't find
much usefull information online as of yet.
Reply With Quote
  #7  
Old 09-07-2010
mhoward
 
Posts: n/a
Re: Running an MSI file on a remote machine

You can check this tool
Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Running an MSI file on a remote machine"
Thread Thread Starter Forum Replies Last Post
Running a batch file from a remote machine in a VB code Radhu Software Development 1 14-10-2011 04:54 PM
Running script on remote machine SuderMan Windows Server Help 12 25-08-2010 06:51 PM
Is it possible to run any .exe in the remote machine using WMI? Swati_here_2008 Software Development 3 05-05-2008 06:45 PM
WMI to remote machine AndyS Windows Server Help 3 17-10-2007 07:42 PM
Execute a BAT File in a remote machine Juanjillo Windows Server Help 4 23-02-2007 01:55 PM


All times are GMT +5.5. The time now is 10:02 PM.