473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

hello guys..need help on wmi event handling..

Hi
i have written a vbscript to manage permanent event consumer classes of wmi ..
here i used the NTEventLogEventConsumer class to store the specific event notification in the windows event log...heres my script....
Expand|Select|Wrap|Line Numbers
  1. strComputer = "."
  2. Set objWMIServices = GetObject("winMgmts:" _
  3. & "{impersonationLevel=impersonate}!\\" & _
  4. strComputer & "\root\subscription")
  5. Set objEventFilterClass = objWMIServices.Get("__EventFilter")
  6. Set objEventFilter = objEventFilterClass.SpawnInstance_() 
  7. objEventFilter.Name = "ProcessTrace" 
  8. objEventFilter.QueryLanguage = "WQL"
  9. objEventFilter.Query ="SELECT * from __InstanceOperationEvent WHERE TargetInstance ISA 'Win32_ProcessTrace'" 
  10. objEventFilter.EventNamespace="root\cimv2"
  11. objEventFilter.CreatorSID=Array(1,1,0,0,0,0,0,5,18 ,0,0,0)
  12. objEventFilter.Put_()
  13. Set objConsumerClass =objWMIServices.Get("NTEventLogEventConsumer")
  14. Set objConsumer=objConsumerClass.SpawnInstance_()
  15. objConsumer.Name="CONNTProcesstrace"
  16. objConsumer.Category=0
  17. objConsumer.SourceName="WinMgmts"
  18. objConsumer.EventType=1
  19. objConsumer.NumberOfInsertionStrings=2
  20. objConsumer.CreatorSID=Array(1,1,0,0,0,0,0,5,18,0, 0,0)
  21. objConsumer.InsertionStringTemplates=Array("%TargetInstance.Name%","%TargetInstance.ProcessId%")
  22. objConsumer.Put_()
  23. Set objBindingClass=objWMIServices.Get("__FilterToConsumerBinding")
  24. Set objBindingInstance=objBindingClass.SpawnInstance_( )
  25. objBindingInstance.Consumer="CONNTProcesstrace"
  26. objBindingInstance.Filter="ProcessTrace"
  27. objBindingInstance.CreatorSID=Array(1,1,0,0,0,0,0, 5,18,0,0,0)
  28. objBindingInstance.Put_()
  29.  
now the script doesnt show any syntax error or runtime error....
but in the wbem log file it generates a message...

(Thu Feb 15 08:47:55 2007.711296) : Event subsystem was unable to perform the necessary operations to accomodate a change to the system state.
The state of the database may not reflect the state of the event subsystem (8004103A)

the error code "8004103A" refers to invalid object path...
but i cant figure it...which object path it reffering....
pls help me out of this...
Feb 15 '07 #1
0 1272

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Pavils Jurjans | last post by:
Hallo, I have been programming for restricted environments where Internet Explorer is a standard, so I haven't stumbled upon this problem until now, when I need to write a DOM-compatible code. ...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
106
by: xtra | last post by:
Hi Folk I have about 1000 procedures in my project. Many, many of them are along the lines of function myfuntion () as boolean on error goto er '- Dim Dbs as dao.database Dim Rst as...
8
by: Tim Geiges | last post by:
Since I am being challenged with learning c# I figured I could pass some of the pain on to you guys :-) I have another question(this one is important for me to fix before I can get my app to Beta)...
4
by: hillcountry74 | last post by:
Hi, I'm a newbie and trying to understand event handling in c#. I have understood handling events using delelgate objects. But not this method- "Event handling by overriding the virtual...
3
by: Ashok Kumar K | last post by:
Hi all, Where can I get some insight on using the __hook, __unhook, event_source and event_receiver for specifically COM events. The documentation given in MSDN is very minimal. I have the...
14
by: Kenneth P. Graci | last post by:
ok all you smart people and low level gurus how do i detect the close of a combbox's drop down list? there must be a way and i'm to dumb to figure it out.
4
by: mflll | last post by:
I am looking into the different techniques of handling arrays of edit boxes in Java Script. The first program below works fine. However, are there better ways of doing this, where the person...
10
by: Peter Michaux | last post by:
Hi, Today I have been testing the event models from Netscape 4.8 and IE 4 to the current crop of browsers. I'd like to write a small event library similar in purpose to the Yahoo! UI event...
3
by: ciffycyclops | last post by:
Hi i have written a vbscript to manage permanent event consumer classes of wmi .. here i used the NTEventLogEventConsumer class to store the specific event notification in the windows event...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.