SetAdminPort Method

The SetAdminPort method of the SPGlobalAdmin class sets the port number for the administration virtual server.

Parameters

nPort    A 32-bit integer that specifies the port number.

bSsl   true to use a Secure Sockets Layer (SSL) connection to the port; otherwise, false.

Remarks

Using the SetAdminPort method does not update the start menu link unless the thread is a single-threaded apartment (STA) thread.

Example

The following code example sets the port number for the administrative virtual server and uses an atttribute to specify an STA thread.

If this approach is not possible, then the application must create a new thread and set the ApartmentState property to STA, as in the next example:

If the code is running in an ASPX page, the ASPCompat attribute in the page directive must be set to TRUE. For example, <%@Page ASPCompat="TRUE"%>.

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security