共用方式為


GlobalModulesSection 類別

公開 IIS 全域模組的組態設定。

Syntax

class GlobalModulesSection : ConfigurationSectionWithCollection  

方法

下表列出 類別所 GlobalModulesSection 公開的方法。

名稱 描述
加入 (繼承自 ConfigurationSectionWithCollection.)
清除 (繼承自 ConfigurationSectionWithCollection。)
Get (繼承自 ConfigurationSectionWithCollection。)
GetAllowDefinition (繼承自 ConfigurationSection.)
GetAllowLocation (繼承自 ConfigurationSection。)
移除 (繼承自 ConfigurationSectionWithCollection。)
RevertToParent (繼承自 ConfigurationSection。)
SetAllowDefinition (繼承自 ConfigurationSection。)
SetAllowLocation (繼承自 ConfigurationSection。)

屬性

下表列出 類別所 GlobalModulesSection 公開的屬性。

名稱 描述
GlobalModules GlobalModuleElement物件的陣列。
Location (繼承自 ConfigurationSection .) 金鑰屬性。
Path (繼承自 ConfigurationSection .) 金鑰屬性。
SectionInformation (繼承自 ConfigurationSection。)

子類別

這個類別不包含子類別。

備註

<globalModules>ApplicationHost.config檔案中的 區段會指定伺服器層級的原生模組。 您可以在ApplicationHost.config或Web.config檔案中,將其名稱新增至 <modules> 所需的組態層級區段,以啟用這些模組。 在 WMI 中,您可以使用ModulesSection類別的 方法來執行此 Add 動作。

範例

下列範例會列出 區段中的 <globalModules> 模組。

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")  
  
' Get the ApplicationHost.config <globalModules> section.  
Set oSection = oWebAdmin.Get( _  
    "GlobalModulesSection.Path=" & _  
    "'MACHINE/WEBROOT/APPHOST/',Location=''")  
  
' Display the path.  
WScript.Echo  
WScript.Echo "Path: " & oSection.Path  
WScript.Echo  
  
' Display the global modules.  
WScript.Echo "Global Modules"  
WScript.Echo "--------------"  
For Each oGMElement In oSection.GlobalModules  
     WScript.Echo "Module: " & oGMElement.Name  
     WScript.Echo "Image: " & oGMElement.Image  
     WScript.Echo "PreCondition: " & oGMElement.PreCondition  
     WScript.Echo  
Next  

繼承階層架構

ConfigurationSection

ConfigurationSectionWithCollection

GlobalModulesSection

規格需求

類型 描述
Client - Windows Vista 上的 IIS 7.0
- Windows 7 上的 IIS 7.5
- Windows 8 上的 IIS 8.0
- Windows 10上的 IIS 10.0
伺服器 - Windows Server 2008 上的 IIS 7.0
- Windows Server 2008 R2 上的 IIS 7.5
- Windows Server 2012 上的 IIS 8.0
- Windows Server 2012 R2 上的 IIS 8.5
- Windows Server 2016上的 IIS 10.0
產品 - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0
MOF 檔案 WebAdministration.mof

另請參閱

ConfigurationSection 類別
ConfigurationSectionWithCollection 類別
GlobalModuleElement 類別
ModulesSection 類別