0% found this document useful (0 votes)
12 views7 pages

Get-Service - Checking Windows Services Status With PowerShell - TheITBros

The document provides a comprehensive guide on using the Get-Service cmdlet in PowerShell to check the status of Windows services. It covers basic and advanced usage, including how to filter services by name, status, and dependencies, as well as how to check services on remote computers. The Get-Service cmdlet is presented as a powerful alternative to traditional service management methods.

Uploaded by

AMANUALE D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views7 pages

Get-Service - Checking Windows Services Status With PowerShell - TheITBros

The document provides a comprehensive guide on using the Get-Service cmdlet in PowerShell to check the status of Windows services. It covers basic and advanced usage, including how to filter services by name, status, and dependencies, as well as how to check services on remote computers. The Get-Service cmdlet is presented as a powerful alternative to traditional service management methods.

Uploaded by

AMANUALE D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

About the Authors Contact Us   

Microsoft  Linux  Internet  Others  

Home  Windows  PowerShell  Get-Service: Checking Windows Services Status with PowerShell

PowerShell PowerShell TOP posts: Windows

Get-Service: Checking Windows Services Status with PowerShell


written by Cyril Kardashevsky 4K views

The built-in Get-Service PowerShell cmdlet can be used to get a list of Windows services, check
their statuses, filter them by name or service status. Let’s learn how to use Get-Service to check
Windows services.

Contents  ADVERTISEMENT

1. Syntax and Basic Usage of the Get-Service Cmdlet


2. Get-Service: Advanced Usage Examples
3. Check Services on a Remote Computer with PowerShell

Syntax and Basic Usage of the Get-Service Cmdlet


Ad
The basic syntax and available parameters of the Get-Service cmdlet are as follows:
Looking for More Content? We May Have
You Want
DiscoveryFeed
Get-Service [[-Name] <string[]>] [-ComputerName <string[]>] [-DependentServices] [-RequiredServic
es] [-Include <string[]>] [-Exclude <string[]>] [<CommonParameters>]

When run without parameters, the Get-Service command displays a list of all the services on the
local computer and their statuses.

To check whether the specific service is running or not, specify its name or DisplayName:

Get-Service wuauserv

Or

Get-Service -DisplayName "Windows Update"


Find Out More Personalised Content Here
DiscoveryFeed
Get the status of multiple services at once:
Ad
Get-Service WSLService, WwanSvc, WlanSvc

If you don’t know the exact name of the service, you can use wildcards. For example, to list all
services whose display name starts with Microsoft:

Get-Service -DisplayName Microsoft*

Use the Where-Object cmdlet to list only services with a specific state. For example, list all
stopped services:

Get-Service | Where-Object {$_.status -eq 'stopped'}


Ad

Personalized Content Tailored to Your


Preferences - All in One Place
DiscoveryFeed

Get-Service: Advanced Usage Examples


ADVERTISEMENT
The Get-Service cmdlet returns a default property set consisting of the following properties:

Status — Indicates the current service status. The possible values are: Stopped,
StartPending, StopPending, Running, ContinuePending, PausePending, Paused.

Name — Displays the short name of the service


Display Name — Show the friendly name of the service.
Ad

However, other service object properties are not displayed. You can see them all by running the Check Out Our Recommendations Curate
for You
command below: DiscoveryFeed

Get-Service | Get-Member | Where-Object { $_.MemberType -like "*property" } | Select-Object Name,


MemberType

Among these other properties, the most preferred when checking the service status is the
StartType, which indicates whether the service start type is:

Automatic — Service starts automatically during the system start-up.

Manual — Service must be started manually by a user or application.

AutomaticDelayedStart — service starts automatically on boot after core network services


are run.

Disabled — Service is disabled.

List services whose StartType is Automatic.


Get-Service | Where-Object { $_.StartType -eq 'Automatic' } | Select-Object Name, Status, StartTy
pe

List services that should start automatically but are not currently running:

Get-Service | Where-Object { $_.StartType -eq 'Automatic' -and $_.Status -ne 'Running' } | Select
-Object Status, Name, DisplayName, StartType

Get service dependency. Such services may fail to start if their dependent services are not
running:

Get-Service Dfs -RequiredServices

According to the result below, the Dfs service has six dependencies, and one is not running
(Stopped), which is the RemoteRegistry. Ad
Check Services on a Remote Computer with PowerShell
The Get-Service cmdlet retrieves the service status in the local computer by default. But it is
capable of getting the service status on a remote computer.

On Windows PowerShell, the Get-Service cmdlet has a parameter called -ComputerName that
accepts an array of computer names to query. This method uses the Distributed Component
Object Model (DCOM) to connect to the remote machine and execute the command against it.

For example, this command retrieves the status of the services on the remote computers named
DC1 and PCX.

Get-Service -Name WinRM -ComputerName DC1,PCX | Select-Object Status,Name,MachineName

On PowerShell Core (6.x+), the -ComputerName parameter has been removed from the Get-
Service cmdlet because of PowerShell Core’s move away from DCOM. Instead, you must use the
Invoke-Command cmdlet, which uses the WinRM to communicate to remote machines.

Invoke-Command -ComputerName DC1, PCX {Get-Service WinDefend, wuauserv | Select-Object Status, Na


me, DisplayName}

The Get-Service PowerShell cmdlet is an easy and powerful way to check the status of Windows
services on local or remote computers. It can easily replace the old-school ways of managing
services using the Services MMC snap-in (services.msc) or the sc query console command.

POWERSHELL
Our newsletter is full of great content!
Subscribe TheITBros.com newsletter to get the latest content via email.

Your name, IT Brother! 

SUBSCRIBE!

3    

Cyril Kardashevsky
I enjoy technology and developing websites. Since 2012 I'm running a few of
my own websites, and share useful content on gadgets, PC administration
and website promotion.

 

previous post next post


Allow Non-administrators to Install Printer Drivers Configuring Active Directory Sites and Subnets

1 COMMENT

PATRICK BURWELL REPLY


 September 27, 2022 - 6:39 pm

‘(Get-Service -Name wuauserv).StartupType’ is wrong to identify if “disabled”


Like this:
if((Get-Service -computername $server -Name “ArcGIS Server”).StartType -ieq
“disabled”){continue}

LEAVE A COMMENT

Your Comment

Name* Email*

Save my name, email, and website in this browser for the next time I comment.
SUBMIT

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  

Privacy Policy Contact Us Sitemap

@2023 - TheITBros.com. Owned and operated by KARDASHEVSKIY K.B. FOP

You might also like