Share via


SPWebServerCollection Class

Represents a collection of SPWebServer objects.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPAutoSerializingObject
    Microsoft.SharePoint.SPBaseCollection
      Microsoft.SharePoint.Administration.SPWebServerCollection

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public Class SPWebServerCollection _
    Inherits SPBaseCollection

Dim instance As SPWebServerCollection
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public class SPWebServerCollection : SPBaseCollection

Remarks

Use the WebServers property of the SPGlobalConfig class to get the collection of Web servers in a server farm. Use an indexer to return a single Web server from the collection. For example, if the collection is assigned to a variable named myWebServers, use myWebServers[index] in C#, or myWebServers(index) in Visual Basic .NET, where index is the index number of the server in the collection.

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

SPWebServerCollection Members

Microsoft.SharePoint.Administration Namespace