Меню Рубрики

Wmi cim studio windows 7

Утилита WMI CIM Studio — часть 1

Утилита WMI CIM Studio входит в состав пакета WMI Tools, который можно бесплатно сказать на сайте Майкрософт. После установки пакета в папке WMI Tools будут находится несколько утилит, которые помогают работать с инструментарием Windows Management Instrumentation. В этой статье мы рассмотрим только утилиту WMI CIM Studio, и то, только первую часть из общего описания.

Сама утилита является простым htm файлом с именем studio.htm, так как этот детище дядюшки Билла, то запускать файл нужно с помощью обозревателя IE. Вероятнее всего сработает защита вида:

«В целях безопасности Internet Explorer не разрешает этому веб-узлу выполнение сценариев или элементов управления ActiveX»

После того, как мы разрешим выполнение сценария, перед нами появится диалоговое окно, сообщающее информацию о сборке, жмем ОК и идем дальше.

После перед нами появится диалоговое окно для выбора пространства имен (например, root\CIMV2), нажимаем ОК, потом еще раз ОК (если, конечно, вы не продвинутый пользователь и не желаете подключиться к удаленной системе).

После того как мы произведем вход в приложение WMI CIM Studio, перед нами будут два окна, левое – проводник классов (Class Explorer), а правое — просмотрщик классов (Class Viewer). Они между собой связаны, так как при выборе класса WMI в левом окне, в правом будет отображаться информация о нем. Давайте рассмотри каждое окно в отдельности.

Проводник классов WMI (Class Explorer)

Окно проводника классов Windows Management Instrumentation отображает иерархическую структуру всех классов из выбранного пространства имен WMI.

Слева, возле имени класса, находятся значки различных оттенков серого и белого цвета, они позволяют определить тип класса.

  • Темно-серый квадрат – класс является обычным
  • Светло-серый квадрат – абстрактный класс, для которого наследниками определены обычные классы
  • Белый квадрат – абстрактный класс без наследников
  • Темно-серый квадрат со стрелкой – класс является обычным ассоциативным
  • Светло-серый квадрат со стрелкой – абстрактный ассоциативный класс, для которого наследниками определены обычные ассоциативные классы
  • Белый квадрат с белой стрелкой – абстрактный ассоциативный класс без наследников

Как выглядят визуально квадраты. Вы можете увидеть на рисунке ниже.

Для выполнения заданной операции в утилите WMI Studio над группой классов (смотрите статью «Классы WMI, пространство имен и CIM»), их достаточно отметить галочкой. Если надо отметить все классы, то достаточно нажать правую кнопку мыши и выбрать во всплывающем меню пункт Select All, там же есть и другие пункт, назначение которых понятно по их названиям.

Также в окне проводника классов вверху находятся четыре кнопки в виде значков:

  • Browse for Namespace – отвечает за выбор пространства имен WMI для локального или удаленного подключения.
  • Search for Class – отвечает за поиск классов в выбранном (текущем) пространстве имен
  • Add class – позволяет добавить в репозиторий CIM новый класс
  • Delete class – позволяет удалить из репозитория CIM выбранный класс.

Просмотрщик классов WMI (Class Viewer)

Правое окно – просмотрщик классов, отвечает за отображение информации о выбранном слева классе или о заданном экземпляре класса. В окне находятся три вкладки:

  • Properties – свойства выбранного класса
  • Methods – методы выбранного класса

  • Associations – данная вкладка отображает ассоциативные связи выбранного класса с другими классами Windows Management Instrumentation.

Как вы заметили из рисунков, вверху просмотрщика классов утилиты WMI CIM Studio находятся кнопки в виде значков, их назначение следующее:

  • Create instance – отвечает за создание нового экземпляра для выбранного класса
  • Delete instance – отвечает за удаление выбранного экземпляра класса
  • Back – предыдущая страница
  • Forward – следующая страница
  • Save – позволяет сохранить в репозитории CIM сделанные изменения
  • Instances – отвечает за отображение для заданного класса всех его экземпляров
  • Views – позволяет отфильтровать отображаемые классы WMI, например, нужно ли отображать системные и наследуемые свойства класса.
  • WQL Query – позволяет запустить редактор WQL запросов, для создания, сохранения или удаления WQL запросов.
  • Help for Class – справочная информация для выбранного класса WMI или класса выбранного экземпляра.

Внешний вид пиктограмм можете увидеть на картинке ниже.

Хорошо, в следующей статье мы рассмотрим вторую часть по изучению утилиты WMI CIM Studio («Утилита WMI CIM Studio — часть 2»).

Спасибо за внимание. Автор блога Владимир Баталий

Источник

Get to Know the IIS 7.0 WMI Provider Using CIM Studio

Introduction

This document introduces WMI CIM Studio, a tool that provides a visual interface for exploring WMI namespaces. Using the IIS «WebAdministration» namespace, you learn how to enumerate classes in a namespace, view the properties and methods on a class, search classes and properties for a specific word like «restriction», and much more – all without writing one script.

Before you can do anything in WMI, you must connect to a namespace. The first section of this document describes how to download and open CIM Studio, enumerate all namespaces, and connect to a specific namespace.

The second portion of this document shows how to explore classes in a namespace by viewing their properties and methods, and property/method metadata such as whether a property is read only or read/write. Finally, you get object instances and interact with them by setting properties and executing methods. This is WMI, visual and demystified.

Before You Start

Install IIS

IIS 7.0 or above must be installed to complete the steps in this document. If you can browse to http://localhost and receive the standard IIS «Under Construction» page, then IIS is installed. If IIS is not installed, please refer to Installing IIS on Windows Vista for installation instructions.

Install WMI Provider

Install the IIS WMI provider by selecting the IIS Management Scripts and Tools component under Management Tools (or Web Management Tools). In Windows Vista, this is in the Windows Features dialog under Internet Information Services. On Windows ServerВ® 2008, this is in the Server Manager under the Web Server (IIS) role.

Install WMI Tools (includes CIM Studio)

Install the WMI Tools suite from the Microsoft Download Center before starting.

Required Privileges and User Account Control (UAC)

You must be an administrator to connect to the WebAdministration WMI namespace. This means that you are logged in as:

  • The built-in Administrator account on Longhorn Server
  • A member of the Administrators group and you have disabled User Account Control (UAC)
  • A member of the Administrators group and UAC is enabled

If you are in the first or second situation, you will not encounter any permissions problems with this article.

If you are in the third situation, you will encounter Access is Denied errors. Avoid these problems by always opening command prompts as Administrator and by launching CIM Studio from an elevated command prompt.

To open a command prompt as Administrator, click Start, click All Programs, click Accessories, right-click Command Prompt, and select Run as Administrator.

To launch CIM Studio from an elevated command prompt:

  1. Open a command prompt as Administrator.
  2. Type %systemdrive%\Program Files\WMI Tools\studio.htm andpress Enter.

Make a Backup

Backup key IIS configuration files before beginning so that you can restore your system to its original state after you have finished.

  1. Open a command prompt.
  2. Type %windir%\system32\inetsrv\appcmd add backup IIS7\_WMI\_CIMStudioLab .
  • After you have finished, restore IIS to its original state by opening the command prompt as administrator and typing %windir%\system32\inetsrv\appcmd restore backup IIS7\_WMI\_CIMStudioLab .

1. Connect to the WebAdministration Namespace

Click Start, click All Programs, click WMI Tools, and click WMI CIM Studio.

If you are prompted with the following dialog, click Close.

If the yellow information bar indicates that Internet Explorer is blocking active content, right-click the information bar and click the Allow Blocked Content. option. You then receive a Security Warning asking you if you are sure you want to let this file run active content; click Yes.

If you wish to avoid this security warning in the future, click on the Tools drop-down menu on the right hand side of Internet Explorer 7, select Internet Options. , click on the Advanced tab, scroll down to the Security settings and check «Allow active content to run in files on my computer». Click OK.

You will see the dialog below when CIM Studio opens. This dialog allows you to connect to a specific WMI namespace. Click the browse button circled in red below.

The browse button brings up the namespace browsing dialog below. Click the Connect button.

CIM Studio now pops up a login dialog, as shown below. Click OK.

The dialog shows a tree view of namespaces available under «root» after connecting to the root namespace. Scroll to the bottom to see «WebAdministration», the new IIS WMI namespace. Double-click the WebAdministration folder icon to connect to the namespace.

CIM Studio pops up a login dialog again. Click OK.

After successfully connecting to the WebAdministration namespace, the left side of CIM Studio window looks similar to the screen shot below. Check to see that your namespace is called «root\WebAdministration» as shown below.

2. Explore Classes

The list of classes in the WebAdministration namespace looks similar to the screen shot below. The classes circled in red are the base classes for the WebAdministration provider; the classes that are not circled and begin with a double underscore «__» are WMI standard classes that are not related specifically to the WebAdministration provider.

Expand the tree under the Object class. Expand the tree under the ConfiguredObject class. You now see a tree view that contains familiar web server objects such as Site and Application, as shown below. These objects are the central focus of the WebAdministration WMI namespace and you will likely spend most of your time interacting with these objects.

Select the Site object. When you select an object, the right-hand pane of the CIM Studio window provides information about that object. The screen shot below shows the Properties tab. The Properties tab shows the names of the Site properties, their type, and their value. You notice that the value column contains mostly » » strings because we are looking at the definition of the Site object, not an instance of Site (we look at instances in later). Note that all properties beginning with double underscore «__» are standard WMI class properties and can be ignored while learning WMI basics.

To know if the Site Id property is read-only or read/write, right-click on Id and select Property Qualifiers.

The dialog below shows the «qualifiers» for the Id property. Qualifiers are metadata about a property. The «read» and «write» qualifiers describe whether a property can be read or written; both the read and write qualifiers have a value of true for the Id property, so this property is read/write.

  1. Click the Cancel button.
  2. Click the Methods tab to see the Site methods, as shown below.

To know what parameters the Create method takes, right-click on the Create method and select Edit Method Parameters. This menu item launches a dialog box that contains a list of the parameters for the Create method, as shown below. The return type for the method is specified at the bottom of the dialog. Take care not to modify any of the method parameters; only use this dialog to view the method parameters.

Click the Cancel button.

Take another look at the Site properties by clicking the Properties tab in the right pane. The Bindings property has a type «array of object:BindingElement»; i.e. an array of BindingElement objects. Next, take a look at the BindingElement class to see what properties a BindingElement has.

Click the Search button, circled in red below.

Type BindingElement into the search text box and click the Go! button. The «Search results:» text box displays an entry called BindingElement.

Double-click BindingElement entry in the search results to go to the BindingElement class definition.

3. Get Object Instances

Use search to find the «Site» class again. Click the Instances Of button, shown circled in red below, to see all instances of the Site object.

All instances of the Site object are displayed in blue text in the right hand panel of CIM Studio, as shown below. Double-click on the Default Web Site instance for detailed information about that Site object.

Now CIM Studio displays information about the Default Web Site. The Site name is displayed at the top of the right hand pane, and the properties on the Property tab have real values instead of » «. The «LogFile» property has a button labeled Object in its Value column instead of a real value. Click this Object button.

The Object button launches a dialog that shows the properties of the LogFile object, as shown below. These properties enable/disable logging, define the format of the log file, specify the logging directory, etc.

Click inside the Value field for the LocalTimeRollover property. Click the drop-down to see the options for this value, and select «true». This field now shows «true»; the text is in blue because this property has been modified.

Click the OK button. The Save button, shown below circled in red, has become available because the LogFile.LocalTimeRollover property is modified. Click the Save button.

To see this change in configuration, click Start, click Run, and type notepad %windir%\system32\inetsrv\applicationHost.config . Click the Edit menu, and select Find. Type «localTimeRollover» to find the newly added configuration. The configuration should appear similar to the XML below, and the localTimeRollover configuration property should be set to «true».

Close the applicationHost.config file (click No if notepad asks if you would like to save changes). Now we execute one of the Site methods. Click the Methods tab, right click the GetState method, and select Execute Method. Click the Execute button.

The return value is 1, or «Started». How do we know that? Click Close. Right click the GetState method and select Method Qualifiers…. This brings up the GetState method metadata, including ValueMap and Values which describe how the return values map to human readable data. Click the Array button in the Values row to see the different states.

Summary

In this document you have learned how to connect to a WMI namespace, how to search for a class, how to discover the properties and methods for a class, how to determine whether a property is read/write or read-only, how to find the parameters for a method, how to get instances of a specific object, how to interactively change properties on an object instance, and how to view the properties of an embedded object.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Wm3945abg mow2 драйвер windows 7
  • Wm71 15 драйвер на windows 10
  • Wlsetup all exe windows xp
  • Wlp54g driver windows 7
  • Wlidcli dll windows 7