SPWindowsService Class

Represents a Windows service that is installed on one or more servers in the server farm.

Inheritance Hierarchy


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


<GuidAttribute("914E6AD5-6504-4691-AFEE-ABDB42520258")> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public Class SPWindowsService _
    Inherits SPService
Dim instance As SPWindowsService
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public class SPWindowsService : SPService


Windows services enable you to create long-running executable applications that run in their own Windows sessions, can be automatically started when the computer starts up, can be paused and restarted, and do not show any user interface. Windows services are ideal for use on a server or whenever you need long-running functionality that does not interfere with other users who are working on the same computer. Windows services are the type of services listed in the Services snap-in within the Administrative Tools for a server.

To return the parent Windows service of a Windows service instance, use the inherited Service property of the SPWindowsServiceInstance class. Use the Services property to get a specific Windows service that is implemented within the server farm.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also


SPWindowsService Members

Microsoft.SharePoint.Administration Namespace