SiteElementDefaults Class1

Contains the default values for IIS Web site properties.

Syntax

class SiteElementDefaults : EmbeddedObject  

Methods

This class contains no methods.

Properties

The following table lists the properties exposed by the SiteElementDefaults class.

Name Description
Limits A SiteLimits ojbect that represents the connection-related limits for a site.
LogFile A SiteLogFile object that contains the log file configuration information for a Web site.
ServerAutoStart A read/write boolean value. true if the Web site will start when the World Wide Web Publishing Service (WWW Service) starts; otherwise, false. The default is true.
TraceFailedRequestsLogging A TraceFailedRequestsLogging object that exposes the default read/write logging properties for Web sites.

Subclasses

This class contains no subclasses.

Remarks

Instances of this class are contained in the SiteDefaults property of the Server class.

Example

The following example sets the maximum number of allowed connections for all Web sites to 100, and then sets the BytesSent, BytesRecv, and TimeTaken flags of the LogExtFileFlags attribute to true.

' 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_  
  

Inheritance Hierarchy

EmbeddedObject

SiteElementDefaults

Requirements

Type Description
Client - IIS 7.0 on Windows Vista
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on Windows Server 2008
- IIS 7.5 on Windows Server 2008 R2
- IIS 8.0 on Windows Server 2012
- IIS 8.5 on Windows Server 2012 R2
- IIS 10.0 on Windows Server 2016
Product - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
MOF file WebAdministration.mof

See Also

EmbeddedObject Class
Server Class
Site Class
SiteLogFile Class