包含 IIS 網站屬性的預設值。
Syntax
class SiteElementDefaults : EmbeddedObject
方法
這個類別不包含方法。
屬性
下表列出 類別所 SiteElementDefaults 公開的屬性。
| 名稱 | 描述 |
|---|---|
Limits |
SiteLimits ojbect,代表月臺的連線相關限制。 |
LogFile |
SiteLogFile物件,其中包含網站的記錄檔組態資訊。 |
ServerAutoStart |
讀取/寫入 boolean 值。 true 如果萬維網發佈服務 (WWW 服務) 啟動時,網站將會啟動;否則為 false 。 預設值為 true。 |
TraceFailedRequestsLogging |
TraceFailedRequestsLogging物件,會公開網站的預設讀取/寫入記錄屬性。 |
子類別
這個類別不包含子類別。
備註
這個類別的實例包含在 SiteDefaultsServer 類別的 屬性中。
範例
下列範例會將所有網站的允許連線數目上限設定為 100,然後將 屬性的 、 和 旗標設定 BytesSent 為 true 。 TimeTakenBytesRecvLogExtFileFlags
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
Set oSvr = oWebAdmin.Get("Server=@")
' Show the limit to be changed.
WScript.Echo "Old maxiumum number of connections: " & oSvr.SiteDefaults.Limits.MaxConnections
' Specify the new limit and save the result.
oSvr.SiteDefaults.Limits.MaxConnections = 1000
oSvr.Put_
' Show the new limit.
WScript.Echo "New maxiumum number of connections: " & oSvr.SiteDefaults.Limits.MaxConnections
' Define the flag constants.
CONST BYTES_SENT = 4096
CONST BYTES_RECV = 8192
CONST TIME_TAKEN = 16384
' Configure the flags of the LogExtFileFlags attribute and save the result.
oSvr.SiteDefaults.LogFile.LogExtFileFlags = oSvr.SiteDefaults.LogFile.LogExtFileFlags Or BYTES_SENT
oSvr.SiteDefaults.LogFile.LogExtFileFlags = oSvr.SiteDefaults.LogFile.LogExtFileFlags Or BYTES_RECV
oSvr.SiteDefaults.LogFile.LogExtFileFlags = oSvr.SiteDefaults.LogFile.LogExtFileFlags Or TIME_TAKEN
oSvr.Put_
繼承階層架構
SiteElementDefaults
規格需求
| 類型 | 描述 |
|---|---|
| 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 |