Share via


SPFarm.Create method (SqlConnectionStringBuilder, SqlConnectionStringBuilder, String, SecureString, SecureString)

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)

Syntax

'Declaration
Public Shared Function Create ( _
    configurationDatabase As SqlConnectionStringBuilder, _
    administrationContentDatabase As SqlConnectionStringBuilder, _
    farmUser As String, _
    farmPassword As SecureString, _
    masterPassphrase As SecureString _
) As SPFarm
'Usage
Dim configurationDatabase As SqlConnectionStringBuilder
Dim administrationContentDatabase As SqlConnectionStringBuilder
Dim farmUser As String
Dim farmPassword As SecureString
Dim masterPassphrase As SecureString
Dim returnValue As SPFarm

returnValue = SPFarm.Create(configurationDatabase, _
    administrationContentDatabase, _
    farmUser, farmPassword, masterPassphrase)
public static SPFarm Create(
    SqlConnectionStringBuilder configurationDatabase,
    SqlConnectionStringBuilder administrationContentDatabase,
    string farmUser,
    SecureString farmPassword,
    SecureString masterPassphrase
)

Parameters

  • farmUser
    Type: System.String

    An 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.Security.SecureString

    An object that contains the password for the server farm account that is used for the administrative site application pool and timer service. The text is encrypted for privacy when it is used, and deleted from computer memory when it is no longer needed.

  • masterPassphrase
    Type: System.Security.SecureString

    An object that contains the master passphrase for the server farm account that is used for the administrative site application pool and timer service. The master passphrase can be any combination of any characters, including spaces, tabs, and so on, that is not precluded by the application. The text is encrypted for privacy when it is used, and deleted from computer memory when it is no longer needed.

Return value

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

Remarks

When a String object 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