Управление сервисами power shell

PowerShell Service Management: Tips & Tricks for Experts

List of content you will read in this article:

Powershell List Services

  • Step 1: Open PowerShell

Begin by launching PowerShell on your system. Use the Start menu or search bar to find and open the application.

Managing Windows services with PowerShell

Managing Windows services with PowerShell

  • Step 2: Execute the List Services Command

This command fetches and displays a comprehensive list of all services running on your Windows system.

  • Step 3: Review the Service List

After executing the command, review the displayed list of services. Each service is accompanied by essential details such as its display name, service name, and status.

This is a sample of the output you’ll receive.

Status   Name               Display Name

------   ----               -----------

Running  AcrSch2 class="link-id"Svc         Acronis Scheduler2 Service

Running  AdobeUpdateService AdobeUpdateService

Running  afcdpsrv           Acronis Nonstop Backup Service

Running  AGMService         Adobe Genuine Monitor Service

Stopped  AJRouter           AllJoyn Router Service

Stopped  ALG                Application Layer Gateway Service

Stopped  AppIDSvc           Application Identity

Stopped  Appinfo            Application Information

Stopped  AppMgmt            Application Management

Stopped  AppReadiness       App Readiness

Stopped  AppVClient         Microsoft App-V Client

Stopped  AppXSvc            AppX Deployment Service (AppXSVC)

Running  Audiosrv           Windows Audio

Stopped  AxInstSV           ActiveX Installer (AxInstSV)

Stopped  BDESVC             BitLocker Drive Encryption Service

Running  BFE                Base Filtering Engine

In the output, by default, you will see 3 main sections: Status, Name, and Display Name.

Now, if you want to search and list a particular service, you can filter out any parameters.

  • Show all services whose names start with wi:

Get-Service -Name wi*

  • Show all services whose display names start with win:

Get-Service -DisplayName win*

  • Note: If you want to access another computer through the network, you can see the list of services for that system with this command:
:/>  Windows xp включить общий доступ и как разрешить доступ к компьютеру в локальной сети windows xp

Get-Service -ComputerName Server1

An important part of service management is the management of Dependent Services.

Get-Service -Name WinDefend -DependentServices

  • You can also use the Required Services parameter to get a list of service pre-requisites.

Get-Service -Name WinDefend - RequiredServices

So with the above commands, we can find the name of the service we are looking for, see the status and related services or its prerequisites. Now we want to explain the services’ management commands.

Powershell Stop Service

  • Step 1: Open PowerShell

Open PowerShell on your system. You can do this by searching for “PowerShell” in the Start menu and selecting the application.

Managing Windows services with PowerShell

Managing Windows services with PowerShell

  • Step 2: Identify the Service

Determine the name of the service you want to stop. This information is vital for executing the correct PowerShell command.

  • Step 3: Execute the Stop Command

Stop-Service -Name Windefend

Ensure that in every PowerShell service scenario, you begin by opening PowerShell on your system. This can be done by searching for PowerShell in the Start menu and selecting the application. Afterward, identify the service and determine the name of the service you intend to stop. This information is crucial for executing the correct PowerShell command.

Powershell Start Service

  • starting a service in PowerShell you can use this command:

Start-Service -Name Windefend

Powershell Restart Service

  • One of the most commonly used commands to work with services is service restarting in PowerShell command. The structure of the service restarting command is as such:

Restart-Service -Name Windefend

Powershell Suspend Service

Suspend-Service -Name Windefend

Powershell Get Service

Execute the Get Service Command:

:/>  Обнаружение скрытого потенциала сенсорной клавиатуры Windows 7 и получение контроля над экранной и сенсорной клавиатурой в Windows 11 — разблокировка решений по активации, настройке и устранению неполадок

Get-Service -Name "YourServiceName"

Replace “YourServiceName” with the actual name of the service you want to retrieve information about.

Windows servers can be run with Powershell, you can manage and run your services in Windows Server with PowerShell.

Before diving into advanced PowerShell tasks, ensure you’re using the latest features and capabilities by verifying your software’s currency. For a quick guide on how to do this, check out our article on Check PowerShell Version to stay up-to-date and make the most of your scripting experience.