Share via


SPWindowsServiceInstance.Enable method

Enables the service on the local computer.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

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