Posted in

uninstall a Windows service on Windows Server 2022

To uninstall a Windows service on Windows Server 2022 using PowerShell, follow these steps:

  1. Open PowerShell with Administrative Privileges:

    • Click on the Start menu.
    • Type PowerShell.
    • Right-click on Windows PowerShell and select Run as administrator.
  2. Identify the Service Name:

    • First, you need to know the service name (not the display name) of the service you want to uninstall. You can list all services and find the one you need by running:

      Get-Service
    • Note the Name of the service you want to uninstall.
  3. Stop the Service:

    • Before uninstalling, you need to stop the service if it is running:

      Stop-Service -Name "ServiceName"

    Replace "ServiceName" with the actual name of your service.

  4. Uninstall the Service:

    • Use the following command to uninstall the service:

      sc.exe delete "ServiceName"

    Replace "ServiceName" with the actual name of your service.

Here’s a summary of the commands you might run:


# Open PowerShell as administrator # List all services Get-Service # Stop the service (replace "ServiceName" with the actual service name) Stop-Service -Name "ServiceName" # Uninstall the service (replace "ServiceName" with the actual service name) sc.exe delete "ServiceName"

After running these commands, the service should be uninstalled from your Windows Server 2022.

Leave a Reply

Your email address will not be published. Required fields are marked *