I have an app that relies on receiving cluster event notification from WMI by doing this:
Dim localObjWmiService As Object
Set localObjWmiService = CreateObject("winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!\\" & strClusterName & "\root\MSCluster")
localObjWmiService.ExecNotificationQueryAsync OMAAgent.msClusterEvent, "Select * from MSCluster_EventStateChange"
and then picking up the events in the notification query event.
All works perfectly until the cluster service is stopped and started. Then WMI does not deliver any events ever again until the WMI Management Instrumentation service is restarted.
It would appear to me that WMI is holding onto a defunct cluster notification port?
It may be that this is fixed in a version of windows later than my test setup which is Server 2003 R2. I can repeat this at will.
Setting up the WMI query again makes no difference. Does anyone have any idea of a way around this other than doing all the notification work myself with CreateClusterNotifyPort? My app is an old VB6 app and creating a notification port appears to be problematic in that language.
thanks