Extending the WMI Implementation

The current WMI implementation isn’t a very scalable solution, so we’ll implement the same strategies that we used for file monitoring.

Extending the WMI Class

We need to create a more robust and scalable WMI class that allows for multiple instances of monitored servers. In addition, we want to be able to predefine a query that we can use to retrieve specific information.

Because of the extensive nature of changes to the WMI class, I will reprint the code in Example 8-6 and then review the changes.

Example 8-6. Extended WMI class.

Public Class WMI Private m_Error As String = Nothing Private m_Scope As ManagementScope = Nothing Private m_Path As ManagementPath = Nothing Private m_Outgoing As Thread = Nothing Private ...

Get Programming Windows® Services with Microsoft® Visual Basic® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.