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
"I just know that I know nothing"
Socrates (469-399 B.C.E.)
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
"I just know that I know nothing"
Socrates (469-399 B.C.E.)