473,385 Members | 1,863 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,385 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 952

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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.