Re: Remotely installing Filters and consumers
- From: "Scott McNairy \(MVP\)" <v-scomcn@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 7 Jun 2005 15:25:11 -0700
Please see this link.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/smtpeventconsumer.asp
it says that you have to compile the smtpcons.mof file located in the wbem
directory to the root\cimv2 namespace in this case first.
This unfortunately leads to other errors in the script but this hopefully
gets you started.
--
Scott McNairy
Microsoft MVP - Windows Server Management Infrastructure
"Dave" <NOSPAMd.ford@xxxxxxxxxx> wrote in message
news:Xns965BAAA641126NOSPAMdfordbathacuk@xxxxxxxxxxxxxxx
> 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_()
.
- Prev by Date: Re: Does a corrupted WMI mean a very slow PC?
- Next by Date: Re: Win32_Printer.Location setting help
- Previous by thread: Re: Does a corrupted WMI mean a very slow PC?
- Next by thread: WMI and Linux
- Index(es):
Relevant Pages
|
Loading