次の方法で共有


SPGlobalAdmin.ExtendVirtualServerInWebFarm method (Uri, String, Boolean, String, Boolean, String, String)

NOTE: This API is now obsolete.

To extend a Web application to a new Internet Information Services (IIS) Web site, add a new entry to the IIS settings through the IisSettings property of the SPWebApplication class. SharePoint Foundation automatically handles duplication of IIS Web sites on other computers in the server farm. (In Windows SharePoint Services 2.0, the ExtendVirtualServerInWebFarm method extended a virtual server in a server farm with SharePoint Foundation, and is maintained for backward compatibility.)

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

Syntax

'Declaration
<ObsoleteAttribute("To extend a web application to a new iis web site, add a new entry to SPWebApplication.IisSettings.  Duplicating IIS Web Sites on other machines in the farm is now handled automattically.",  _
    False)> _
Public Function ExtendVirtualServerInWebFarm ( _
    uri As Uri, _
    strVirtualServerName As String, _
    bCreateNewAppPool As Boolean, _
    strAppPoolId As String, _
    bConfigurableAppPoolAccount As Boolean, _
    strAppPoolUserName As String, _
    strAppPoolPassword As String _
) As SPVirtualServer
'Usage
Dim instance As SPGlobalAdmin
Dim uri As Uri
Dim strVirtualServerName As String
Dim bCreateNewAppPool As Boolean
Dim strAppPoolId As String
Dim bConfigurableAppPoolAccount As Boolean
Dim strAppPoolUserName As String
Dim strAppPoolPassword As String
Dim returnValue As SPVirtualServer

returnValue = instance.ExtendVirtualServerInWebFarm(uri, _
    strVirtualServerName, bCreateNewAppPool, _
    strAppPoolId, bConfigurableAppPoolAccount, _
    strAppPoolUserName, strAppPoolPassword)
[ObsoleteAttribute("To extend a web application to a new iis web site, add a new entry to SPWebApplication.IisSettings.  Duplicating IIS Web Sites on other machines in the farm is now handled automattically.", 
    false)]
public SPVirtualServer ExtendVirtualServerInWebFarm(
    Uri uri,
    string strVirtualServerName,
    bool bCreateNewAppPool,
    string strAppPoolId,
    bool bConfigurableAppPoolAccount,
    string strAppPoolUserName,
    string strAppPoolPassword
)

Parameters

  • uri
    Type: System.Uri

    An absolute URI for the virtual server, which includes the host name, port number, and custom URL information. For example, if the URI is https://Server_Name:Port_Number/Sample_URL, when the virtual server is extended Sample_URL is included as part of the URL.

  • strVirtualServerName
    Type: System.String

    A string that specifies the name of a virtual server that contains a content database to use for the extended server.

  • bCreateNewAppPool
    Type: System.Boolean

    true to create an application pool; otherwise, false.

  • strAppPoolId
    Type: System.String

    A string that specifies an ID for the application pool.

  • bConfigurableAppPoolAccount
    Type: System.Boolean

    true to specify that the application pool account is configurable; otherwise, false.

  • strAppPoolUserName
    Type: System.String
    • A string that specifies a user name for the administrator account of the application pool. If true, specify one of the following values:

    • NetworkService

    • LocalService

    • LocalSystem

  • strAppPoolPassword
    Type: System.String

    A string that specifies a password for the administrator account of the application pool. The parameter is required only if the parameter is set to true.

Return value

Type: Microsoft.SharePoint.Administration.SPVirtualServer
An SPVirtualServer object that represents the extended virtual server.

Remarks

The ExtendVirtualServerInWebFarm method does not create a new content database, but connects the extended server to the content database of the specified virtual server.

Before extending a virtual server by using the ExtendVirtualServerInWebFarm method, you can customize the web.config file that will be placed on the server by creating an XML file that supplements the web.config file on the current server. For information, see Working with web.config Files in Windows SharePoint Services.

See also

Reference

SPGlobalAdmin class

SPGlobalAdmin members

ExtendVirtualServerInWebFarm overload

Microsoft.SharePoint.Administration namespace