Re: Remotely installing filters and consumers
- From: "Jim Vierra" <jvierra@xxxxxxx>
- Date: Thu, 19 May 2005 23:30:30 -0400
Hi Manfred. Now I know who to go to for my event problems.
I think you got it. I looked but didn't see that.
--
Jim Vierra
"Manfred Braun" <aa@xxxxx> wrote in message
news:OjbBvJLXFHA.3996@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> Im not sure, if I am too blind, but is this script working or just a
> repro?
> I am missing a line containing code such:
>
> Set objSMTPBindingClass =
> objSWbemServices.Get("__FilterToConsumerBinding")
>
> You have made:
>
> Set objSMTPBindingInstance = objBindingClass.SpawnInstance_()
>
> but I do not see any point, where you create the class. I also alsways
> recommend to use Option Explicit to get some support/help from the
> scripting
> engine ;-)
>
> Just a short quick try to give possibly help ...
>
> Best regards,
> Manfred
>
> "Dave" <buggeroff@xxxxxxxxxx> wrote in message
> news:Xns965BBCCB49D80forddbathacuk@xxxxxxxxxxxxxxxxx
>> Subject: Remotely installing Filters and consumers
>> From: Dave <NOSPAMd.ford@xxxxxxxxxx>
>> Newsgroups: microsoft.public.windowsxp.wmi
>>
>> I'm trying to create a filter/consumer pairing to monitor any reduction
>> in the number of pointing objects (ie. mice) attached to my lab machines
>> (I'm in a teaching enviroment).
>>
>> I can do this on a local machine with a vbscript run as administrator,
>> but I'm having great trouble doing it to remote machines - of course, I
>> don't _need_ to be able to do it remotely, but I feel I really should
>> know why I can't.
>>
>> The essential bits of my script goes as per below.
>>
>> Using wbemtest, they all appear to have gone into my target machine - but
>> I either get an error 0x80041002 in the event log of the remote machine
>> (probably me not clearing out non-working eventfilters before I re-run
>> the script), and a line:
>>
>> (Thu May 19 16:43:20 2005.201428015) : Repository called with a thread
>> token! It shall be removed
>>
>> In Wbemcore.log. I can find little about doing this sort of thing
>> remotely (as I said, it all seems to work fine locally). I don't think
>> permissions are (at least not directly) the problem, as this script is
>> running within the context of a administrator on both my machine and the
>> target.
>>
>> Can anyone offer me advice as to anything I've done obviously wrong, or
>> resources on the net that may be of use?
>>
>> Many thanks
>> Dave,
>> Bath.
>>
>>
>>
>> Set objSWbemServices = GetObject("winmgmts:
>> {impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
>>
>> Set objEventFilterClass = objSWbemServices.Get("__EventFilter")
>> Set objEventFilter = objEventFilterClass.SpawnInstance_
>> Set objSMTPConsumerClass = objSWbemServices.Get("SMTPEventConsumer")
>> Set objSMTPConsumer = objSMTPConsumerClass.SpawnInstance_()
>> Set objSMTPBindingInstance = objBindingClass.SpawnInstance_()
>>
>> objEventFilter.Name = "MouseDeleteEventFilter"
>> 'objEventFilter.EventNamespace = ""
>> objEventFilter.QueryLanguage = "WQL"
>> objEventFilter.Query = "SELECT * FROM __InstanceDeletionEvent " &_
>> "WITHIN 5 WHERE TargetInstance ISA " &_
>> """Win32_PointingDevice"""
>> objEventFilter.Put_
>>
>> objSMTPConsumer.Name = "MouseRemovedEMAIL"
>> objSMTPConsumer.ToLine = "xxxx@xxx"
>> objSMTPConsumer.FromLine = "xxx@xxx"
>> objSMTPConsumer.ReplyToLine = "xxx@xxxx"
>> objSMTPConsumer.SMTPServer = "mailhost"
>> objSMTPConsumer.Subject = "Mouse Theft alert!"
>> objSMTPConsumer.Message = "Someone has has just unplugged a mouse from "
>> & strComputer &"."
>> objSMTPConsumer.Put_()
>>
>>
>> objSMTPBindingInstance.Filter = "\\" & strComputer & "\root\cimv2:
>> __EventFilter.Name=""MouseDeleteEventFilter"""
>> objSMTPBindingInstance.Consumer="\\" & strComputer & "\root
>> \cimv2:SMTPEventConsumer.Name=""MouseRemovedEMAIL"""
>> objSMTPBindingInstance.Put_()
>>
>
>
.
- References:
- Remotely installing filters and consumers
- From: Dave
- Re: Remotely installing filters and consumers
- From: Manfred Braun
- Remotely installing filters and consumers
- Prev by Date: Re: Question about WMI connection and concurrent use
- Next by Date: Re: wmi and DCOM launch permissions
- Previous by thread: Re: Remotely installing filters and consumers
- Next by thread: Re: Remotely installing filters and consumers
- Index(es):
Relevant Pages
|