共用方式為


SPFarm.Create Method (SqlConnectionStringBuilder, String, String)

NOTE: This API is now obsolete.

Creates a server farm and its associated configuration database, based on the specified user and password.

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

Syntax

'Declaration
<ObsoleteAttribute("Use the SPFarm.Create method that takes a passphrase.",  _
    False)> _
Public Shared Function Create ( _
    configurationDatabase As SqlConnectionStringBuilder, _
    farmUser As String, _
    farmPassword As String _
) As SPFarm
'Usage
Dim configurationDatabase As SqlConnectionStringBuilder
Dim farmUser As String
Dim farmPassword As String
Dim returnValue As SPFarm

returnValue = SPFarm.Create(configurationDatabase, _
    farmUser, farmPassword)
[ObsoleteAttribute("Use the SPFarm.Create method that takes a passphrase.", 
    false)]
public static SPFarm Create(
    SqlConnectionStringBuilder configurationDatabase,
    string farmUser,
    string farmPassword
)

Parameters

  • farmUser
    Type: System.String

    A String object that contains the user name for the server farm account that is used for the administrative site application pool and timer service.

  • farmPassword
    Type: System.String

    A String object that contains the password for the server farm account that is used for the administrative site application pool and timer service.

Return Value

Type: Microsoft.SharePoint.Administration.SPFarm
An SPFarm object that represents the new server farm.

Remarks

When a string contains sensitive information such as a password, there is a risk that the information might be revealed after it is used because your application cannot delete the data from computer memory. You can provide the farmPassword parameter as a SecureString object to help protect it from accidental or malicious exposure.

The username and password that you provide must be associated with a domain account.

See Also

Reference

SPFarm Class

SPFarm Members

Create Overload

Microsoft.SharePoint.Administration Namespace

Create(SqlConnectionStringBuilder, String, SecureString)