ServerContext.GetContext method (String)
Gets the ServerContext instance for the specified Shared Services Provider.
Namespace: Microsoft.Office.Server
Assembly: Microsoft.Office.Server (in Microsoft.Office.Server.dll)
Syntax
'Declaration
Public Shared Function GetContext ( _
sharedResourceProviderName As String _
) As ServerContext
'Usage
Dim sharedResourceProviderName As String
Dim returnValue As ServerContext
returnValue = ServerContext.GetContext(sharedResourceProviderName)
public static ServerContext GetContext(
string sharedResourceProviderName
)
Parameters
sharedResourceProviderName
Type: System.StringThe name of a Shared Resource Provider in the local farm.
Return value
Type: Microsoft.Office.Server.ServerContext
A ServerContext object.
Examples
//replace SSP_GUID with a string containing the application GUID for the SSP //hosting the search service
SearchContext srchContext = ServerContext.GetContext("SSP_GUID");