5.4 WMI and some Windows applications


5.4 WMI and some Windows applications

5.4.1 Microsoft Office

Both Office 2000 and Office XP come with their WMI instance providers. Office 2000 registers a provider called OffProv in the Root\MSAPPS namespace, while Office XP registers a provider called OffProv10 in the Root\MSAPPS10 namespace (see Table 5.29).

Table 5.29: The Office Provider Capabilities

Provider Name

Provider Namespace

Class Provider

Instance Provider

Method Provider

Property Provider

Event Provider

Event Consumer Provider

Support Get

Support Put

Support Enumeration

Support Delete

Office 2000 and XP Providers

OffProv (Office 2000)

Root/MSAPPS

X

X

X

OffProv10 (Office XP)

Root/MSAPPS10

X

X

X

Both providers support a set of classes representing management information about Office. Office XP comes with some additional classes compared with Office 2000. Table 5.30 shows the classes available under Office 2000 and Office XP.

Table 5.30: The Office 2000 and Office XP Classes

Office 2000

Office XP

N/A

Win32_Access10AlternateStartupFileLoc

N/A

Win32_Access10ComAddin

N/A

Win32_Access10ComAddins

N/A

Win32_Access10DefaultFileLoc

N/A

Win32_Access10JetComponents

N/A

Win32_Access10StartupFolder

Win32_AccessDatabase

Win32_AccessDatabase

Win32_AccessProject

Win32_AccessProject

Win32_AccessSummary

Win32_AccessSummary

N/A

Win32_ADOCoreComponents

N/A

Win32_Excel10AlternateStartupFileLoc

N/A

Win32_Excel10DefaultFileLoc

N/A

Win32_Excel10StartupFolder

Win32_ExcelActiveWorkbook

Win32_ExcelActiveWorkbook

Win32_ExcelActiveWorkbookNotable

Win32_ExcelActiveWorkbookNotable

Win32_ExcelAddIn

Win32_ExcelAddIn

Win32_ExcelAddIns

Win32_ExcelAddIns

Win32_ExcelChart

Win32_ExcelChart

Win32_ExcelCharts

Win32_ExcelCharts

N/A

Win32_ExcelComAddin

N/A

Win32_ExcelComAddins

Win32_ExcelSheet

Win32_ExcelSheet

Win32_ExcelSummary

Win32_ExcelSummary

Win32_ExcelWorkbook

Win32_ExcelWorkbook

Win32_FrontPageActivePage

Win32_FrontPageActivePage

Win32_FrontPageActiveWeb

Win32_FrontPageActiveWeb

Win32_FrontPageAddIn

Win32_FrontPageAddIn

Win32_FrontPageAddIns

Win32_FrontPageAddIns

Win32_FrontPagePageProperty

Win32_FrontPagePageProperty

Win32_FrontPageSummary

Win32_FrontPageSummary

Win32_FrontPageTheme

Win32_FrontPageTheme

Win32_FrontPageThemes

Win32_FrontPageThemes

Win32_FrontPageWebProperty

Win32_FrontPageWebProperty

N/A

Win32_JetCoreComponents

Win32_OdbcCoreComponent

Win32_OdbcCoreComponent

Win32_OdbcDriver

Win32_OdbcDriver

N/A

Win32_OfficeWatsonLog

Win32_OleDbProvider

Win32_OleDbProvider

N/A

Win32_OutlookAlternateStartupFile

N/A

Win32_OutlookComAddin

N/A

Win32_OutlookComAddins

N/A

Win32_OutlookDefaultFileLocation

N/A

Win32_OutlookStartupFolder

Win32_OutlookSummary

Win32_OutlookSummary

N/A

Win32_PowerPoint10AlternateStartupLoc

N/A

Win32_PowerPoint10ComAddin

N/A

Win32_PowerPoint10ComAddins

N/A

Win32_PowerPoint10DefaultFileLoc

N/A

Win32_PowerPoint10Font

N/A

Win32_PowerPoint10Fonts

N/A

Win32_PowerPoint10Hyperlink

N/A

Win32_PowerPoint10Hyperlinks

N/A

Win32_PowerPoint10PageNumber

N/A

Win32_PowerPoint10PageSetup

N/A

Win32_PowerPoint10SelectedTable

N/A

Win32_PowerPoint10StartupFolder

N/A

Win32_PowerPoint10Table

N/A

Win32_PowerPoint10Tables

Win32_PowerPointActivePresentation

Win32_PowerPointActivePresentation

Win32_PowerPointPresentation

Win32_PowerPointPresentation

Win32_PowerPointSummary

Win32_PowerPointSummary

N/A

Win32_Publisher10ActiveDocument

N/A

Win32_Publisher10ActiveDocumentNoTable

N/A

Win32_Publisher10AlternateStartupFileLocation

N/A

Win32_Publisher10CharacterStyle

N/A

Win32_Publisher10COMAddIn

N/A

Win32_Publisher10COMAddIns

N/A

Win32_Publisher10DefaultFileLocation

N/A

Win32_Publisher10Font

N/A

Win32_Publisher10Fonts

N/A

Win32_Publisher10Hyperlink

N/A

Win32_Publisher10Hyperlinks

N/A

Win32_Publisher10MailMerge

N/A

Win32_Publisher10PageNumber

N/A

Win32_Publisher10PageSetup

N/A

Win32_Publisher10ParagraphStyle

N/A

Win32_Publisher10Sections

N/A

Win32_Publisher10SelededTable

N/A

Win32_Publisher10StartupFolder

N/A

Win32_Publisher10Styles

N/A

Win32_Publisher10Table

N/A

Win32_Publisher10Tables

Win32_PublisherSummary

Win32_PublisherSummary

N/A

Win32_RDOCoreComponents

Win32 SerrerExtension

Win32_ServerExtension

Win32 Transport

Win32_Transport

Win32 WebConnectionError

Win32_WebConnectionError

Win32_WebConnectionErrorMessage

Win32_WebConnectionErrorMessage

Win32_WebConnectionErrorText

Win32_WebConnectionErrorText

Win32_WordActiveDocument

Win32_Word10ActiveDocument

Win32_WordActiveDocumentNotable

Win32_Word10ActiveDocumentNotable

Win32_WordAddin

Win32_Word10Addin

N/A

Win32_Word10AlternateStartupFileLocation

Win32_WordCharacterStyle

Win32_Word10CharacterStyle

N/A

Win32_Word10DefaultFileLocation

Win32_WordDocument

Win32_Word10Document

Win32_WordField

Win32_Word10Field

Win32_WordFields

Win32_Word10Fields

Win32_WordFileConverter

Win32_Word10FileConverter

Win32_WordFileConverters

Win32_Word10FileConverters

Win32_WordFont

Win32_Word10Font

Win32_WordFonts

Win32_Word10Fonts

Win32_WordHeaderAndFooter

Win32_Word10HeaderAndFooter

Win32_WordHyperlink

Win32_Word10Hyperlink

Win32_WordHyperlinks

Win32_Word10Hyperlinks

Win32_WordMailMerge

Win32_Word10MailMerge

Win32_WordPageNumber

Win32_Word10PageNumber

Win32_WordPageSetup

Win32_WordPageSetup

Win32_WordParagraphStyle

Win32_WordParagraphStyle

Win32_WordSections

Win32_Word10Sections

Win32_WordSelectedTable

Win32_Word10SelectedTable

Win32_WordSettings

Win32_Word10Settings

N/A

Win32_Word10StartupFileLocation

Win32_WordStyles

Win32_Word10Styles

Win32_WordSummary

Win32_Word10Summary

Win32_WordTable

Win32_Word10Table

Win32_WordTables

Win32_Word10Tables

Win32_WordTemplate

Win32_Word10Template

N/A

Win32_WordComAddin

N/A

Win32_WordComAddins

As shown in Table 5.29, the information about Office instances can't be updated. For instance, if you need to determine if a Word document is open, you can request the instances of the Win32_WordDocument class. The output would be as follows:

 1:    C:\>GetCollectionOfInstances.wsf Win32_WordDocument /Namespace:Root\MSAPPS 2:    Microsoft (R) Windows Script Host Version 5.6 3:    Copyright (C) Microsoft Corporation 1996–2001. All rights reserved. 4: 5: 6:    CreateDate: .............................. 20010118112800.******+*** 7:    *Name: ................................... MyWordDocument.doc 8:    Path: .................................... C:\MyDocuments\MyWordDocument.doc 9:    Size: .................................... 295 

5.4.2 Internet Explorer

Internet Explorer 5.0 (and later) provides a WMI instance provider called IEINFO5. This provider supports a collection of classes representing the configuration settings of Internet Explorer. These classes are available in the Root\CIMV2\Applications\MicrosoftIE namespace (see Table 5.31).

Table 5.31: The Internet Explorer Provider Capabilities

Provider Name

Provider Namespace

Class Provider

Instance Provider

Method Provider

Property Provider

Event Provider

Event Consumer Provider

Support Get

Support Put

Support Enumeration

Support Delete

Windows Server 2003

Windows XP

Windows 2000 Server

Windows 2000 Professional

Windows NT 4.0

Internet Explorer Provider

ieinfo5

Root/CIMv2/Applications/MicrosoftIE

X

X

X

X

X

X

X

As with the Office provider, the Internet Explorer provider doesn't support update of the configuration settings. Therefore, it is a read-only mode provider (see Table 5.32).

Table 5.32: The Internet Explorer WMI Classes

Name

Description

MicrosoftIE_Summary

Retrieves the various settings of Internet Explorer, such as the active printer, the build number, Java Virtual Machine version Service Pack levels and fixes, version, etc.

MicrosoftIE_ConnectionSettings

Retrieves the Dial-up connection settings of Internet Explorer.

MicrosoftIE_Object

Retrieves information about the various ActiveX, Codecs, Objects added to Internet Explorer.

MicrosoftIE_Publisher

Retrieves Internet Explorer publisher information.

MicrosoftIE_LanSettings

Retrieves the LAN connection settings of Internet Explorer.

MicrosoftIE_FileVersion

Retrieves Internet Explorer files information (date, version, etc.).

MicrosoftIE_Certificate

Retrieves Internet Explorer certificates information.

MicrosoftIE_ConnectionSummary

Retrieves Internet Explorer connection summary.

MicrosoftIE_Cache

Retrieves Internet Explorer cache settings.

MicrosoftIE_Security

Retrieves Internet Explorer security settings.

The MicrosoftIE_LanSettings class exposes the same information as the Win32_Proxy class. However, with the SetProxySetting method exposed by the Win32_Proxy class, it is possible to update the Proxy LAN settings. You can refer to Chapter 3 (Sample 3.13, "Managing the Windows Proxy LAN settings") for more information about the Win32_Proxy class.

For instance, if you need to know the certificates available from Internet Explorer, you can request the instances of the MicrosoftIE_Certificate class. The output would be as follows:

  1:    C:\>GetCollectionOfInstances.wsf MicrosoftIE_Certificate                                         /Namespace:Root\CIMv2\Applications\MicrosoftIE  2:    Microsoft (R) Windows Script Host Version 5.6  3:    Copyright (C) Microsoft Corporation 1996–2001. All rights reserved.  4:  5:  6:    *IssuedBy: ............................... Hewlett-Packard Primary                                                   Class 2 Certification Authority  7:    *IssuedTo: ............................... Alain Lissoir  8:    SignatureAlgorithm: ...................... md5RSA  9:    *Type: ................................... Personal 10:    Validity: ................................ 21-05-2002 to 22-05-2003 11: 12:    *IssuedBy: ............................... Administrator 13:    *IssuedTo: ............................... Administrator 14:    SignatureAlgorithm: ...................... sha1RSA 15:    *Type: ................................... Personal 16:    Validity: ................................ 01-08-2002 to 31-07-2005 17: 18:    *IssuedBy: ............................... Administrator 19:    *IssuedTo: ............................... Administrator 20:    SignatureAlgorithm: ...................... sha1RSA 21:    *Type: ................................... Personal 22:    Validity: ................................ 01-08-2002 to 08-07-2102 

As another example, if you need to determine the file version used by Internet Explorer, you can request the instances of the MicrosoftIE_FileVersion class. The output would be as follows:

  1:    C:\>GetCollectionOfInstances.wsf MicrosoftIE_FileVersion                                         /Namespace:Root\CIMv2\Applications\MicrosoftIE  2:    Microsoft (R) Windows Script Host Version 5.6  3:    Copyright (C) Microsoft Corporation 1996–2001. All rights reserved.  4:  5:  6:    Company: ................................. Microsoft Corporation  7:    Date: .................................... 20011112140000.******+***  8:    *File: ................................... actxprxy.dll  9:    *Path: ................................... J:\WINDOWS\system32 10:    Size: .................................... 96 11:    Version: ................................. 6.0.3590.0 12: 13:    Company: ................................. Microsoft Corporation 14:    Date: .................................... 20011112140000.******+*** 15:    *File: ................................... advpack.dll 16:    *Path: ................................... J:\WINDOWS\system32 17:    Size: .................................... 89 18:    Version: ................................. 6.0.3590.0 19: 20:    Company: ................................. Microsoft Corporation 21:    Date: .................................... 20011112140000.******+*** 22:    *File: ................................... asctrls.ocx 23:    *Path: ................................... J:\WINDOWS\system32 24:    Size: .................................... 87.5 25:    Version: ................................. 6.0.3590.0 26: 27:    Company: ................................. Microsoft Corporation 28:    Date: .................................... 20011112140000.******+*** 29:    *File: ................................... browselc.dll 30:    *Path: ................................... J:\WINDOWS\system32 31:    Size: .................................... 61.5 32:    Version: ................................. 6.0.3590.0 ..: ..: ..: 




Leveraging WMI Scripting
Leveraging WMI Scripting: Using Windows Management Instrumentation to Solve Windows Management Problems (HP Technologies)
ISBN: 1555582990
EAN: 2147483647
Year: 2003
Pages: 82
Authors: Alain Lissoir

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net