Skip to Content
Microsoft® Windows® Scripting Self-Paced Learning Guide
book

Microsoft® Windows® Scripting Self-Paced Learning Guide

by Ed Wilson
April 2004
Beginner
416 pages
11h 3m
English
Microsoft Press
Content preview from Microsoft® Windows® Scripting Self-Paced Learning Guide

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}") ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft® Windows® 2000 Scripting Guide

Microsoft® Windows® 2000 Scripting Guide

Microsoft Corporation
Professional C# 5.0 and .NET 4.5.1

Professional C# 5.0 and .NET 4.5.1

Christian Nagel, Jay Glynn, Morgan Skinner

Publisher Resources

ISBN: 9780735619814Supplemental ContentCatalog PageErrata