Share via


SPWebServer.AdminPortUrl Property

Gets the URL for the administration port of the Web server.

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

Syntax

'Declaration
Public ReadOnly Property AdminPortUrl As Uri
    Get
'Usage
Dim instance As SPWebServer
Dim value As Uri

value = instance.AdminPortUrl
public Uri AdminPortUrl { get; }

Property Value

Type: System.Uri
An absolute URI that specifies the URL in the form https://Server_Name:Port_Number/.

Examples

The following code example from a console application uses the AdminPortUrl property to display the administrative port URL of each Web server in the SharePoint Foundation deployment.

Dim globalAdmin As New SPGlobalAdmin()
Dim webServers As SPWebServerCollection = globalAdmin.Config.WebServers
Dim webServer As SPWebServer

For Each webServer In  webServers
    Console.WriteLine(webServer.AdminPortUrl + "\n")
Next webServer

Console.ReadLine() 
SPGlobalAdmin globalAdmin = new SPGlobalAdmin();
SPWebServerCollection webServers = globalAdmin.Config.WebServers;

foreach (SPWebServer webServer in webServers)
{
    Console.WriteLine(webServer.AdminPortUrl + "\n");
}

Console.ReadLine();

See Also

Reference

SPWebServer Class

SPWebServer Members

Microsoft.SharePoint.Administration Namespace