Trevor
Wed Oct 11 20:41:29 CDT 2006
D.P. Roberts wrote:
> Is there a way for a script to send me an email message anytime a particular
> file is modified? I already have code to send an email alert - I just need
> the logic that periodically checks the file and sends the alert if it has
> been modified.
>
>
Theoretically, yes, although I've had trouble getting it to work. You'll
want to create a WMI event filter using the __InstanceOperationsEvent
system class that points to the CIM_DataFile class. Then, create an
instance of the ActiveScriptEventConsumer in the root\default namespace,
I believe, and an instance of the FilterToConsumerBinding to fire off
the e-mail script.
There's a lot of information available at the Technet Script Center,
including this article:
http://www.microsoft.com/technet/community/columns/scripts/sg0103.mspx
Trevor Sullivan
MCP