SPWebServer Class

The SPWebServer class represents a front-end Web server in a server farm.

System.Object

   Microsoft.SharePoint.Administration.SPWebServer

Public Properties

The following table shows the public properties of the SPWebServer class, the data type of each property, and a brief description of each.

Name Data type Description
Address String Gets the address of the Web server.
AdminPort Int32 Gets the administration port number for the Web server.
AdminPortUrl System.Uri Gets the URL for the administration port of the Web server.
Id System.Guid Gets the GUID for the Web server.
Name String Gets the name of the Web server.

Thread Safety

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

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.

Example

The following code example displays information in a Console Application about all the front-end Web servers in the Microsoft Windows SharePoint Services deployment.

Requirements

Namespace: Microsoft.SharePoint.Administration

Platforms: Microsoft Windows Server 2003

Assembly: Windows SharePoint Services (in Microsoft.SharePoint.dll)

Security: Code Access Security