WMI issue with VB script


can not find relevant forum name, hence creating thread in "setup deployment" forum


my product installer uses vb custom actions create , manage  scm service.  within vb custom actions, use  wmi classes win32_service, win32_dependentservice manage service.  use class "win32_dependentservice" present under namspace "\root\cimv2" list of depenedent services. on of machines, installer able execute vb custom action uses class "win32_dependentservice". on few machines, custom action fails. installer log shows following runtime error

error number    : 451
error description    : object not collection
source        : microsoft vbscript runtime error
method name    : function
operation    : executing query dependent service list


the code snippet custom action fails below:-

<snip>
set objwmiservice = getobject("winmgmts:" & _
                                "{impersonationlevel=impersonate}!\\" & strcomputer & "\root\cimv2")
  if err <> 0 then
                          reporterror methodname, "creation of winmgmts object handling windows services"
                          exit function
  end if
  set colservicelist = objwmiservice.execquery _
      ("select * win32_service name = 'abc'")
  if err <> 0 then
                          reporterror methodname, "executing query handle existing abc service "
                          exit function
  end if
  each objservice in colservicelist
    set dependentservicelist = objwmiservice.execquery("associators of " _
                                                       & "{win32_service.name='abc'} " _
                                                       & "assocclass=win32_dependentservice " & "role=antecedent" )
     if err <> 0 then
                          reporterror methodname, "executing query dependent service list "
                           exit function
     end if


<\snip>


i doubt wrong there in class "win32_dependentservice".  wmi log file wbemcore.log present @ "c:\windows\system32\wbem\logs" shows following error

<snip>

2008.536529656) : call cwbemnamespace::execquery
   bstr queryformat = wql
   bstr query = select __path,  antecedent, dependent win32_pnpallocatedresource
   ienumwbemclassobject **penum = 0xcffe8
(mon jun 02 20:46:28 2008.536529671) : call cwbemnamespace::execqueryasync
   bstr queryformat = wql
   bstr query = select __path,  antecedent, dependent win32_pnpallocatedresource
   iwbemobjectsink* phandler = 0x0
(mon jun 02 20:46:28 2008.536529687) : query engine request: querying dyn provider <select __path, antecedent, dependent win32_pnpallocatedresource>
(mon jun 02 20:46:29 2008.536529703) : query engine actual: querying dyn provider <select __relpath, __path, antecedent, dependent win32_pnpallocatedresource>
(mon jun 02 20:46:29 2008.536529718) : call cwbemnamespace::getobject
   bstr objectpath = win32_pnpallocatedresource
   long lflags = 0
   iwbemclassobject ** pobj = 0x151f938
(mon jun 02 20:46:29 2008.536530375) : error 80041002 occured executing request cancelprovasynccall sink 043dbc70
(mon jun 02 20:46:29 2008.536530375) : casyncreq_cancelprovasynccall call failed
(mon jun 02 20:46:29 2008.536530437) : call connectionlogin::ntlmlogin
   wsznetworkresource = root\cimv2
   ppreferredlocale = (null)
   lflags = 0x0
(mon jun 02 20:46:29 2008.536530453) : dcom connection nt authority\system @ authentiction level privacy, authnsvc = 10, authzsvc = 0, capabilities = 0
(mon jun 02 20:46:29 2008.536530453) : getuserdefaultlcid failed, restorting system verion(mon jun 02 20:46:29 2008.536530468) : call cwbemnamespace::execquery
   bstr queryformat = wql
   bstr query = select __path,  deviceid, name, description win32_pnpentity
   ienumwbemclassobject **penum = 0x68b6358
(mon jun 02 20:46:29 2008.536530468) : call cwbemnamespace::execqueryasync
   bstr queryformat = wql
   bstr query = select __path,  deviceid, name, description win32_pnpentity
   iwbemobjectsink* phandler = 0x0
(mon jun 02 20:46:29 2008.536530484) : query engine request: querying dyn provider <select __path, deviceid, name, description win32_pnpentity>
(mon jun 02 20:46:29 2008.536530484) : query engine actual: querying dyn provider <select __relpath, __path, deviceid, name, description win32_pnpentity>


<\snip>


the annoying thing same custom action works  , provides list of dependent services if vb custom action called in vb script manually on command line on same machine. fails if called through installer. 

i have followed wmi troubleshooting steps mentioned @ "http://www.microsoft.com/technet/scriptcenter/topics/help/wmi.mspx"  not solve problem. 1 thing have noticed machines on problem seen, use domain admin account install product msi. 
 
any solve problem appreciated. in advance !!

thanks,
abhay.



 

hello abhay,

 

would please post script-related issue in our msdn forum? people there have better knowledge kind of problem , may share more information you.

 

http://forums.microsoft.com/msdn/default.aspx?siteid=1

 

thank understanding , hope issue resolved soon.

 

best regards,

chang yin



Windows Server  >  Setup Deployment



Comments

Popular posts from this blog

Motherboard replacement

Cannot create Full Text Search catalog after upgrading to V12 - Database is not fully started up or it is not in an ONLINE state

Remote Desktop App - Error 0x207 or 0x607