Help..Generic Error-running remote script

G

Guest

I have this peice of Code that will connect to a remote computer, gets a list
of all of the sofware installed on it and writes that information to a
database. The problem is it works on some of the computers and not on
others. I thought it (Service Pack 2) would be a firewall issue, i have
checked all of the firewall settings via group policy and it is not turned
on. I have manullly open up the firewall on the local machine but the script
still returns the error message: which is as follows:

Script: File Local for the vbs. script
Line: Line #
Char: 1
Error: Generic Failure
code: 80041001
Source: SWBemObjectSet

I have research just about every site possible and everything is pointing
towards the firewall, any help is greatly appreciated tp get beyond the issue
and add the information to the datbase.

Partial Script: reads a text file with all of the computers in the, stores
the informaiton and then proceeds to get the information and add the records
to the database.

For Each objItem in objDictionary
strComputer = objDictionary.Item(objItem)
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer& "\root\cimv2")
Set colsettings = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colSettings
objRecordSet.AddNew
Set colsoftware = objWMIService.ExecQuery _
("Select * from Win32_Product")
For Each objSoftware in colSoftware
objRecordSet.AddNew
ObjRecordSet("SystemName") = objComputer.Name
objRecordSet("SoftwareName") = objSoftware.Name
objRecordSet("SoftwareVersion") = objSoftware.Version
objRecordSet("SoftwareVendor") = objSoftware.Vendor
objRecordSet.update
Next
Next
Next
objRecordset.Close
objConnection.Close
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top