Lab 18b Invoking the WMI Moniker to Display the Machine Boot Configuration

In this lab, you explore an alternate method of invoking the WMI moniker. In so doing, you write a WMI script that displays the boot configuration of a machine.

Lab Instructions

  1. Open Notepad.exe.

  2. On the first line, specify Option Explicit to ensure all variables utilized are declared.

  3. Declare three variables (using the same variables we declared in Lab 18a). The variables are objWMIService, colItems, and objItem.

  4. Set objWMIService equal to what comes back from the GetObject method when used in conjunction with the WMI moniker. In addition, define an impersonation level of Anonymous. Your code will look like the following:

    Set objWMIService = GetObject("winmgmts:{impersonationLevel=anonymous}") ...

Get Microsoft® Windows® Scripting Self-Paced Learning Guide 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.