Querying system events: WMI Event Watcher Task
In the previous recipe, one of the most common scenarios was reading system information from WMI. SSIS provides another WMI Task named WMI Event Watcher Task, which is more useful than the Data Reader Task. WMI Event Watcher Task provides a way to watch for a WMI event. This awesome feature will make the SSIS package very powerful. As WMI provides extensive information for the management of objects, interaction with this information as events will be very useful. Scenarios such as watching a folder for new files or watching CPU for 50 percent usage are some of the most common scenarios that can be accomplished with this task.
In this recipe we will watch a folder for new files, and if a new file comes into the folder, we will raise a message box after the WMI Event Watcher Task.
Getting ready
Create an empty directory for watching at this address: C:\SSIS\Ch02_Control Flow Tasks\R11_WMI
Event
Watcher
Task\Files
.
How to do it...
Create a New SSIS...