SPFarm.Open method (SqlConnectionStringBuilder, String, SecureString)
NOTE: This API is now obsolete.
Obsolete. Use the Open() method that takes a passphrase. Returns an object representing a remote SPFarm.
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
<ObsoleteAttribute("Use the SPFarm.Open method that takes a passphrase.", _
False)> _
Public Shared Function Open ( _
connectionString As SqlConnectionStringBuilder, _
username As String, _
password As SecureString _
) As SPFarm
'Usage
Dim connectionString As SqlConnectionStringBuilder
Dim username As String
Dim password As SecureString
Dim returnValue As SPFarm
returnValue = SPFarm.Open(connectionString, _
username, password)
[ObsoleteAttribute("Use the SPFarm.Open method that takes a passphrase.",
false)]
public static SPFarm Open(
SqlConnectionStringBuilder connectionString,
string username,
SecureString password
)
Parameters
connectionString
Type: System.Data.SqlClient.SqlConnectionStringBuilderContains the connection string for the configuration database of the remote server farm.
username
Type: System.StringContains the user name for the server farm account that is used for the administrative site application pool and timer service.
password
Type: System.Security.SecureStringContains 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 being 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 remote server farm.
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | Obsolete. Use the Open() method that takes a passphrase. |
ArgumentNullException | SqlConnectionStringBuilder object is a null reference (Nothing in Visual Basic). |
Remarks
The user name and password that are provided must be associated with a domain account.
This method requires access to the remote farms configuration database. 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.