API Reference
Class
ServiceControllerManager
Provides service controller operations (restart).
Inheritance
- Object
- ServiceControllerManager
Methods
public static ServiceActionResult Restart(String serviceName, Nullable<TimeSpan> timeout = null) #Returns:
ServiceActionResultRestarts a Windows service and returns a status result.
Parameters
- serviceName System.String
- Windows service name.
- timeout System.Nullable{System.TimeSpan} = null
- Optional timeout for stop/start operations.
Returns
Action result.