Accessing WMI from Scripts

Throughout this chapter, we have referred to “management applications or scripts” as potential users of WMI. In practice, however, this book is not about writing—or using—management applications but about scripting. The goal is to arm administrators of Windows-based networks with the knowledge required to automate management tasks by scripting WMI. It seems appropriate, therefore, to briefly consider how a script can interact with WMI.

WMI provides a scripting API, a small set of functions that can be accessed from a scripting language that can be used to find, create, and manipulate WMI objects and classes. These functions include facilities for obtaining object references using object paths or WQL and others for ...

Get Windows Management Instrumentation (WMI) 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.