SPIisSettings Class

Represents the Internet Information Services (IIS) authentication settings that are shared across all of the web servers for a specific URL zone, which can be modified and propagated by re-provisioning the web application.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPAutoSerializingObject
    Microsoft.SharePoint.Administration.SPIisSettings

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public NotInheritable Class SPIisSettings _
    Inherits SPAutoSerializingObject
'Usage
Dim instance As SPIisSettings
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public sealed class SPIisSettings : SPAutoSerializingObject

Remarks

Use the CreateFromExistingWebSite method to create an SPIisSettings object for a specified IIS website, or use the IisSettings property of the SPWebApplication class to return the IIS settings for a particular URL zone. To return the settings for a specific zone, you can specify an SPUrlZone value as an indexer on the IisSettings property.

Setting a property value of the SPIisSettings class, such as AllowAnonymous, does not automatically propagate the new value to all IIS websites across all front-end Web servers. The properties are applied to IIS websites only after the web application is re-provisioned.

Examples

The following example displays, in a console application, the virtual directory path for the Default URL zone of a specified web application.

Dim uri = New Uri("http://MyServer")
Dim webApplication As SPWebApplication = SPWebApplication.Lookup(uri)
Dim iis As SPIisSettings = webApplication.IisSettings(SPUrlZone.Default)
Console.Write(iis.Path + " == " + iis.PreferredInstanceId.ToString())
System.Uri uri = new Uri("http://MyServer");
SPWebApplication webApplication = SPWebApplication.Lookup(uri);
SPIisSettings iis = webApplication.IisSettings[SPUrlZone.Default];
Console.Write(iis.Path + " == " + iis.PreferredInstanceId.ToString());

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SPIisSettings Members

Microsoft.SharePoint.Administration Namespace