SiteElementDefaults Class [IIS 7 and higher]

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

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

See Also

Reference

EmbeddedObject Class [IIS 7 and higher]

Server Class [IIS 7 and higher]

Site Class [IIS 7 and higher]

SiteLogFile Class [IIS 7 and higher]