SPFarm.Open method (SqlConnectionStringBuilder, SecureString)
Returns an object representing a remote server SPFarm object based on the specified connection string.
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Shared Function Open ( _
connectionString As SqlConnectionStringBuilder, _
passphrase As SecureString _
) As SPFarm
'Usage
Dim connectionString As SqlConnectionStringBuilder
Dim passphrase As SecureString
Dim returnValue As SPFarm
returnValue = SPFarm.Open(connectionString, _
passphrase)
public static SPFarm Open(
SqlConnectionStringBuilder connectionString,
SecureString passphrase
)
Parameters
connectionString
Type: System.Data.SqlClient.SqlConnectionStringBuilderAn object that contains the connection string of the configuration database that represents the remote farm.
passphrase
Type: System.Security.SecureStringAn object that contains the passphrase used to generate the master key.
Return value
Type: Microsoft.SharePoint.Administration.SPFarm
An SPFarm object.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | SqlConnectionStringBuilder object is a null reference (Nothing in Visual Basic). |
Remarks
To create a new farm, use the Create method or the Open method.
Either method requires access to the configuration database of the remote farm. If the current user or process identity does not have permission to access the database, or if the local machine is not on the same network as the database, this call will fail with an exception of type SqlException and a message indicating that this is the case.