Compartilhar via


SPWindowsServiceInstance.Enable Method

Enables the service on the local computer.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Protected Friend Shared Sub Enable ( _
    serviceName As String, _
    autoStart As Boolean _
)
'Usage
Dim serviceName As String
Dim autoStart As BooleanSPWindowsServiceInstance.Enable(serviceName, autoStart)
protected internal static void Enable(
    string serviceName,
    bool autoStart
)

Parameters

  • serviceName
    Type: System.String

    A string that contains the Windows name of the service to enable.

  • autoStart
    Type: System.Boolean

    true if the service starts automatically; otherwise, false.

See Also

Reference

SPWindowsServiceInstance Class

SPWindowsServiceInstance Members

Microsoft.SharePoint.Administration Namespace