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

Making the Connection

To get an idea of the types of data accessible from the CIM_Setting element class, you can use the CIMSettingClass.vbs script. This script also illustrates connecting to the MicrosoftIISv2 namespace and using WMI to query for information.

Option Explicit
'On Error Resume Next
Dim strComputer
Dim wmiNS
Dim wmiQuery
Dim objWMIService
Dim colItems
Dim objItem

strComputer = "london"
wmiNS = "/root/MicrosoftIISv2"
wmiQuery = "select * from CIM_Setting"
Set objWMIService = GetObject("winmgmts://" _
    & strComputer & wmiNS)
Set colItems = objWMIService.ExecQuery(wmiQuery)

For Each objItem In colItems
    WScript.Echo ": " & objItem.Name
Next

Header Information

The Header information section of CimSettingClass.vbs, which follows, contains ...

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