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)
Available in Sandboxed Solutions: No
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
configurationDatabase
Type: System.Data.SqlClient.SqlConnectionStringBuilderA SqlConnectionStringBuilder object that specifies the connection string of the configuration database for the new server farm.
administrationContentDatabase
Type: System.Data.SqlClient.SqlConnectionStringBuilderThe content database for the administration Web application.
farmUser
Type: System.StringAn 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.SecureStringAn 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.SecureStringAn 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.