Returns a remote server farm based on the specified connection string, user name, and password.
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)

Syntax
Visual Basic (Declaration)
Public Shared Function Open ( _
connectionString As SqlConnectionStringBuilder, _
username As String, _
password As SecureString _
) As SPFarm
Dim connectionString As SqlConnectionStringBuilder
Dim username As String
Dim password As SecureString
Dim returnValue As SPFarm
returnValue = SPFarm.Open(connectionString, username, password)
public static SPFarm Open (
SqlConnectionStringBuilder connectionString,
string username,
SecureString password
)
Parameters
- connectionString
A System.Data.SqlClient.SqlConnectionStringBuilder object that contains the connection string for the configuration database of the remote server farm.
- username
A string that contains the user name for the server farm account that is used for the administrative site application pool and timer service.
- password
A System.Security.SecureString object that contains the password for the server farm account that is used for the admininstrative site application pool and timer service. The text is encrypted for privacy when it is being used, and deleted from computer memory when it is no longer needed.
Return Value
An
SPFarm object that represents the remote server farm.

Remarks
The user name and password that you provide must be associated with a domain account.

See Also