O'Reilly logo

Pro Windows PowerShell by Hristo Deshev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

22.5. Handling WMI Events

WMI is a complex and powerful tool for managing a Windows network. It is the infrastructure that provides common interfaces to managing operating system devices, services, and applications. PowerShell already has excellent support for querying WMI objects and extracting information about various system components. For details on how to do that, please refer to Chapter 20. With PSEventing, we can go further and handle events that WMI triggers when it detects a change in the operating system environment. The .NET classes from the System.Management namespace, most importantly the ManagementEventWatcher one, are the means of receiving notifications about those changes. The ManagementEventWatcher class is a generic listener; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required