Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WMI (remote) software installation won't work

Status
Not open for further replies.

koquito

IS-IT--Management
Jun 17, 2002
760
US
Hi fellows.
I have a problem with WMI instaling software remotely.
I run the script with domain admin rights on a Win XP Pro box and want to install the software (flash in an MSI package) on another XP box, both computers in the same domain.
The scripts open an msiexec process on the remote box, but that's about it. I've been trying to find the problem but so far no success. Does anyone has an idea of what could be happening.
The script first open a text file with the name of the computers (this part is working fine), then it's install the software (this part is not working properly) and then write an outpt to a file (works fine also).
Any help will be appreciated. HEre is the script

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile ("c:\scripts\comp.txt", 1)
softwarename = "Flash"
Do Until objTextFile.AtEndOfStream
On Error Resume Next
strcomputer= objTextFile.ReadLine
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
rem Connect to WMI on the remote computer
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strcomputer & "\root\cimv2")
if Err.Number=0 then
Set objSoftware = objWMIService.Get("Win32_Product")
errReturn = objSoftware.Install("c:\Installers\Flash\mm_fl_sw_installer.msi",,true)
Set objresultsTextFile = objFSO.OpenTextFile ("c:\scripts\results.txt",8)
objresultsTextFile.WriteLine (softwarename & " software is being intalled on computer " & strcomputer)
objresultsTextFile.Close
End If
if Err.Number<>0 then
Set objresultsTextFile = objFSO.OpenTextFile ("c:\scripts\results.txt",8)
objresultsTextFile.WriteLine ("Problem ocurred while connecting to computer " & strcomputer & " because " & Err.Description)
objresultsTextFile.Close
end if
Error.Number=0
Loop
Wscript.Echo " Software Installation Script has Ended!!"

A+, MCP, CCNA
marbinpr@hotmail.com

&quot;I just know that I know nothing&quot;
Socrates (469-399 B.C.E.)

 
Hello koquito,

Why not first echo out errReturn see what you get there?

regards - tsuji
 
tsuji, I was doing that ebfore. It was returning a "3". What that 3 means? In MIcrosoft I only found information on a "0" and a bignumber(somehting like 2344567) that now I don't remember.

A+, MCP, CCNA
marbinpr@hotmail.com

&quot;I just know that I know nothing&quot;
Socrates (469-399 B.C.E.)

 
under what account will the WMI process be run on the remote machine?
do you need to set ALLUSER=1 or something like that for the msi to install properly??
 
koquito,

Also, it "usually" a symptom of incompatible os, probably win9x/me which does not support win32_product. That is just a possible reason, not a certainty.

- tsuji
 
I am running the script with domain admin rights, the process itself will run under system account on the remote computer. That ALLUSER part that you mention is the same as the TRUE at the end in: ("c:\Installers\Flash\mm_fl_sw_installer.msi",,true)

tsuji, I'm running the script on WIN XP Pro and the process (or where the software needs to be installed) is win XP Pro also.




A+, MCP, CCNA
marbinpr@hotmail.com

&quot;I just know that I know nothing&quot;
Socrates (469-399 B.C.E.)

 
koquito,

Try binding with delegate impersonation and kerberos authority with your principal domainname\servername.
[tt]
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=delegate,authority=kerberos:domainname\servername}!\\" & strcomputer & "\root\cimv2")
[/tt]
- tsuji
 
tsuji,
I tried that and is doing the same thing returning a 3 and opening the process but nothing else.
It's kind of frustrating this thing.
Thank you all for your input, still we need other options.

A+, MCP, CCNA
marbinpr@hotmail.com

&quot;I just know that I know nothing&quot;
Socrates (469-399 B.C.E.)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top