Article written by

A technology enthu and a Windows PowerShell MVP working on SharePoint solutions at Dell Inc. Has deep interests in Windows Server OS & Virtualization.

9 Responses

Page 1 of 1
  1. Tweets that mention Monitoring file creation using WMI and PowerEvents module -- Topsy.com

    [...] This post was mentioned on Twitter by Jan Egil Ring and others. Jan Egil Ring said: RT @ravikanth: Blog: Monitoring file creation using WMI and PowerEvents module http://www.ravichaganti.com/blog/?p=1951 [...]

  2. Ravikanth
    Ravikanth at |

    Testing comments using DISQUS. The WP commenting system was screwed up for some reason.

  3. Episode 135 – Adam Driscoll and the New vWorkspace PowerShell Module « PowerScripting Podcast

    [...] Ravi also has an example of using PowerEvents to perform file monitoring [...]

  4. Job Vermeulen
    Job Vermeulen at |

    The link to the installation of PowerEvents is empty..

  5. Job Vermeulen
    Job Vermeulen at |

    How can i unsubscribe to the events?

  6. Ravikanth
    Ravikanth at |

     Here is the link: http://powerevents.codeplex.com/

  7. Ravikanth
    Ravikanth at |

    http://powerevents.codeplex.com/ has a GUI app to delete the consumer / filter bindings.

  8. Dev
    Dev at |

    Hi Ravikanth, thanks for the post. This is what i have below. It compiles, but does not sense the file. Your input would be appreciated.

    EXECmsdb.dbo.sp_add_alert @name=N’Watcher’, @message_id=0, @severity=0, @enabled=1, @delay_between_responses=0, @include_event_description_in=0, @category_name=N’[Uncategorized]‘,msdb.dbo.sp_add_alert @name=N’Watcher’, @message_id=0, @severity=0, @enabled=1, @delay_between_responses=0, @include_event_description_in=0, @category_name=N’[Uncategorized]‘,=0, @severity=0, @enabled=1, @delay_between_responses=0, @include_event_description_in=0, @category_name=N’[Uncategorized]‘,=0, @enabled=1, @delay_between_responses=0, @include_event_description_in=0, @category_name=N’[Uncategorized]‘,=1, @delay_between_responses=0, @include_event_description_in=0, @category_name=N’[Uncategorized]‘,=0, @include_event_description_in=0, @category_name=N’[Uncategorized]‘,=0, @category_name=N’[Uncategorized]‘,=N’[Uncategorized]‘,@wmi_namespace=N’\.rootcimv2′, @wmi_query=N’ SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE TargetInstance ISA ”CIM_DirectoryContainsFile” and TargetInstance.GroupComponent= ”Win32_Directory.Name=”\\\\machine\\folder1\\folder2””’,=N’\.rootcimv2′, @wmi_query=N’ SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE TargetInstance ISA ”CIM_DirectoryContainsFile” and TargetInstance.GroupComponent= ”Win32_Directory.Name=”\\\\machine\\folder1\\folder2””’,=N’ SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE TargetInstance ISA ”CIM_DirectoryContainsFile” and TargetInstance.GroupComponent= ”Win32_Directory.Name=”\\\\machine\\folder1\\folder2””’,,@job_id=N’fb4ffed2-7456-480b-99f5-94524d2dff00′=N’fb4ffed2-7456-480b-99f5-94524d2dff00′GO

  9. Sap_dreams12
    Sap_dreams12 at |

    Hi Ravikanth,

    I want the list of fielnames and type from the query below in the SMTPConsumer Message but when iam using Group within it is not triggerign email when i remove group it is shootign email can you pls advice

    instance of __EventFilter as $EventFilter{    Name  = “File Copy Filter”;    EventNamespace = “Root\Cimv2″;    Query =”SELECT * From __InstanceCreationEvent WITHIN 10 Where TargetInstance ISA ‘CIM_DATAFile’AND TargetInstance.Drive=’D:’GROUP WITHIN 10″;    QueryLanguage = “WQL”;};
    // 3. Create an instance of __EventConsumer//    derived class. (ActiveScriptEventConsumer//    SMTPEventConsumer etc…)
    instance of SMTPEventConsumer as $SMTPConsumer{    Name = “File Copy SMTP Consumer”;    Message = “A File Named %TargetInstance”;    SMTPServer = “xyz”;    Subject = “File Copy to USB on Computer %TargetInstance.CSName%”;    ToLine = “xyz”;    FromLine = “%TargetInstance.CSName%@xyz.com”;};
     
     

Comments are closed, but trackbacks and pingbacks are open.

%d bloggers like this: