다음을 통해 공유


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)
Available in Sandboxed Solutions: No

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

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.

See Also

Reference

SPFarm Class

SPFarm Members

Open Overload

Microsoft.SharePoint.Administration Namespace