System.ServiceProcess.ServiceController 10.0.0-rc.2.25502.107

About

Provides the System.ServiceProcess.ServiceController API, which allows to connect to a Windows service, manipulate it, or get information about it. Not supported on other platforms.

Key Features

  • Retrieve information from Windows services
  • Connect to and manipulate Windows services (start, pause, stop or other operations)

How to Use

Retrieve Windows service information

using System.ServiceProcess;

// Loop through all installed Windows services and print the name, status and display name.
foreach (ServiceController serviceController in ServiceController.GetServices())
{
    Console.WriteLine("Name: " + serviceController.ServiceName);
    Console.WriteLine("Status: " + serviceController.Status.ToString());
    Console.WriteLine("Display name: " + serviceController.DisplayName);
}

// Loop through all installed device driver services
foreach (ServiceController serviceController in ServiceController.GetDevices())
{
    Console.WriteLine("Name: " + serviceController.ServiceName);
    Console.WriteLine("Status: " + serviceController.Status.ToString());
    Console.WriteLine("Display name: " + serviceController.DisplayName);
}

Manipulate a Windows service

using System.ServiceProcess;

ServiceController service = new("TestServiceName");
if (service.CanStop && service.Status != ServiceControllerStatus.Stopped && service.Status != ServiceControllerStatus.StopPending)
{
    service.Stop();
}

Main Types

The main types provided by this library are:

  • System.ServiceProcess.ServiceController
  • System.ServiceProcess.ServiceControllerStatus
  • System.ServiceProcess.ServiceType

Additional Documentation

Feedback & Contributing

System.ServiceProcess.ServiceController is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on System.ServiceProcess.ServiceController.

Packages Downloads
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard.
77
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard. 8f968b9e79c5721d78cc88e46fe57457fe9d490d When using NuGet 3.x this package requires at least version 3.4.
68
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET as well as .NET Standard.
66
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard.
65
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET as well as .NET Standard.
64
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
63
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard. When using NuGet 3.x this package requires at least version 3.4.
63
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard.
62
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard.
61
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard. When using NuGet 3.x this package requires at least version 3.4.
61
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard. 10dc31ea70c14a33f371cea5a757a3d95b218acf When using NuGet 3.x this package requires at least version 3.4.
60
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard. When using NuGet 3.x this package requires at least version 3.4.
60
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
59
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET as well as .NET Standard.
59
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard.
59
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET Core as well as .NET Standard. When using NuGet 3.x this package requires at least version 3.4.
59
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
58

https://go.microsoft.com/fwlink/?LinkID=799421

.NET Framework 4.6.2

.NET 8.0

.NET 9.0

.NET 10.0

.NET Standard 2.0

Version Downloads Last updated
10.0.0-rc.2.25502.107 2 10/15/2025
10.0.0-rc.1.25451.107 3 09/10/2025
10.0.0-preview.7.25380.108 9 08/16/2025
10.0.0-preview.6.25358.103 15 07/19/2025
10.0.0-preview.5.25277.114 15 06/09/2025
10.0.0-preview.4.25258.110 19 05/17/2025
10.0.0-preview.3.25171.5 22 04/12/2025
10.0.0-preview.2.25163.2 21 03/21/2025
10.0.0-preview.1.25080.5 23 02/27/2025
9.0.10 3 10/15/2025
9.0.9 2 09/13/2025
9.0.8 12 08/08/2025
9.0.7 15 07/14/2025
9.0.6 11 06/14/2025
9.0.5 23 05/17/2025
9.0.4 23 04/13/2025
9.0.3 29 03/14/2025
9.0.2 26 02/15/2025
9.0.1 33 01/19/2025
9.0.0 37 11/13/2024
9.0.0-rc.2.24473.5 31 10/09/2024
9.0.0-rc.1.24431.7 29 09/16/2024
9.0.0-preview.7.24405.7 41 08/13/2024
9.0.0-preview.6.24327.7 51 07/10/2024
9.0.0-preview.5.24306.7 57 06/15/2024
9.0.0-preview.4.24266.19 32 05/24/2024
9.0.0-preview.3.24172.9 43 04/13/2024
9.0.0-preview.2.24128.5 38 03/14/2024
9.0.0-preview.1.24080.9 43 03/09/2024
8.0.1 38 10/09/2024
8.0.0 50 11/16/2023
8.0.0-rc.2.23479.6 56 10/20/2023
8.0.0-rc.1.23419.4 50 09/14/2023
8.0.0-preview.7.23375.6 50 08/23/2023
8.0.0-preview.6.23329.7 55 07/15/2023
8.0.0-preview.5.23280.8 53 07/15/2023
8.0.0-preview.4.23259.5 55 06/25/2023
8.0.0-preview.3.23174.8 45 07/02/2023
8.0.0-preview.2.23128.3 53 07/02/2023
8.0.0-preview.1.23110.8 50 06/27/2023
7.0.1 49 07/22/2023
7.0.0 53 11/14/2022
7.0.0-rc.2.22472.3 46 07/01/2023
7.0.0-rc.1.22426.10 50 06/25/2023
7.0.0-preview.7.22375.6 50 08/23/2022
7.0.0-preview.6.22324.4 57 10/02/2022
7.0.0-preview.5.22301.12 41 06/28/2023
7.0.0-preview.4.22229.4 44 06/29/2023
7.0.0-preview.3.22175.4 48 06/29/2023
7.0.0-preview.2.22152.2 51 06/30/2023
7.0.0-preview.1.22076.8 50 06/29/2023
6.0.2-mauipre.1.22102.15 48 06/30/2023
6.0.2-mauipre.1.22054.8 52 06/29/2023
6.0.1 55 07/18/2023
6.0.0 58 05/16/2023
6.0.0-rc.2.21480.5 55 06/29/2023
6.0.0-rc.1.21451.13 43 07/01/2023
6.0.0-preview.7.21377.19 49 06/24/2023
6.0.0-preview.6.21352.12 49 11/12/2022
6.0.0-preview.5.21301.5 47 09/23/2022
6.0.0-preview.4.21253.7 59 05/17/2023
6.0.0-preview.3.21201.4 52 07/02/2023
6.0.0-preview.2.21154.6 62 11/19/2022
6.0.0-preview.1.21102.12 41 04/22/2023
5.0.0 59 06/29/2022
5.0.0-rc.2.20475.5 43 06/30/2023
5.0.0-rc.1.20451.14 42 09/14/2022
5.0.0-preview.8.20407.11 51 06/29/2023
5.0.0-preview.7.20364.11 45 06/30/2023
5.0.0-preview.6.20305.6 52 06/30/2023
5.0.0-preview.5.20278.1 48 06/18/2023
5.0.0-preview.4.20251.6 55 11/14/2022
5.0.0-preview.3.20214.6 52 05/22/2023
5.0.0-preview.2.20160.6 41 06/30/2023
5.0.0-preview.1.20120.5 54 06/30/2023
4.7.0 59 06/11/2022
4.7.0-preview3.19551.4 49 12/02/2022
4.7.0-preview2.19523.17 46 05/11/2023
4.7.0-preview1.19504.10 47 06/29/2023
4.6.0 50 03/16/2023
4.6.0-rc1.19456.4 45 06/30/2023
4.6.0-preview9.19421.4 45 06/29/2023
4.6.0-preview9.19416.11 54 03/20/2023
4.6.0-preview8.19405.3 53 07/01/2023
4.6.0-preview7.19362.9 46 06/30/2023
4.6.0-preview6.19303.8 48 01/09/2023
4.6.0-preview6.19264.9 54 10/28/2022
4.6.0-preview5.19224.8 52 06/27/2023
4.6.0-preview4.19212.13 42 06/28/2023
4.6.0-preview3.19128.7 56 05/30/2023
4.6.0-preview.19073.11 54 03/19/2023
4.6.0-preview.18571.3 40 07/02/2023
4.5.0 64 10/19/2022
4.5.0-rc1 50 11/12/2022
4.5.0-preview2-26406-04 54 06/29/2023
4.5.0-preview1-26216-02 46 06/30/2023
4.5.0-preview1-25914-04 51 11/03/2022
4.4.1 56 05/06/2023
4.4.0 51 04/16/2023
4.4.0-preview2-25405-01 50 10/26/2022
4.4.0-preview1-25305-02 50 06/30/2023
4.3.0 51 04/05/2023
4.3.0-preview1-24530-04 55 05/16/2023
4.1.0 57 11/03/2022
4.1.0-rc2-24027 49 06/27/2023
4.1.0-beta-23516 48 06/29/2023
4.1.0-beta-23409 52 10/08/2022
4.1.0-beta-23225 47 06/09/2023
4.0.0-beta-23123 46 06/27/2023
4.0.0-beta-23109 50 05/19/2023
4.0.0-beta-23019 53 07/02/2023
4.0.0-beta-22816 41 06/29/2023
4.0.0-beta-22605 44 06/28/2023
4.0.0-beta-22416 44 07/02/2023