How to Get Startup Type of Windows Services Using PowerShell
-
Use the
Get-WmiObject
Cmdlet to Get the Startup Type of Windows Services in PowerShell -
Use the
Get-Service
Cmdlet to Get the Startup Type of Windows Services in PowerShell
Windows Services, also known as NT services, are one of the main components of the Windows operating system, which enables the ability to create long-running executable applications that can run automatically. These services can be useful in building an application that can execute automatically in predefined intervals.
Windows provide various services, and their startup type and status can be known via PowerShell. You can use PowerShell to list out the startup type of every Windows service on the computer.
This tutorial will introduce different methods to find the startup type of Windows services using PowerShell.
Use the Get-WmiObject
Cmdlet to Get the Startup Type of Windows Services in PowerShell
Startup Type refers to the service execution by the operating system when the system starts. For example, if the startup type is set to default automatic, the service automatically starts when the system boots up.
The following example uses the Get-WMIObject
to get the startup type of Windows services. Here, we are trying to display the start mode of winmgmt
.
Get-WmiObject -Query "Select StartMode From Win32_Service Where Name='winmgmt'"
Output:
__GENUS : 2
__CLASS : Win32_Service
__SUPERCLASS :
__DYNASTY :
__RELPATH :
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
StartMode : Auto
PSComputerName :
The above output shows that the start mode of winmgmt
is Auto
, which implies that it starts automatically.
Below is another example to view the startup type on the local computer. It uses the Class
, Property
, and Filter
parameters to select the start mode of the winmgmt
service.
The output will be similar to the previous one.
Get-WmiObject -Class Win32_Service -Property StartMode -Filter "Name='winmgmt'"
Output:
__GENUS : 2
__CLASS : Win32_Service
__SUPERCLASS :
__DYNASTY :
__RELPATH :
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
StartMode : Auto
PSComputerName :
Use the Get-Service
Cmdlet to Get the Startup Type of Windows Services in PowerShell
The Get-Service
cmdlet is another way to display Windows services’ startup type in PowerShell. Using this cmdlet, you can display the StartType
of every service available on the computer.
The following command displays the start type for all services.
Get-Service | select -Property Name, StartType
Output:
AarSvc_d19dd87 Manual
AJRouter Manual
ALG Manual
AppIDSvc Manual
Appinfo Manual
BITS Manual
BluetoothUserService_d19dd87 Manual
Bonjour Service Automatic
Winmgmt Automatic
The startup types can be automatic or manual, depending on your system.
You can also find the startup type of a particular service using Get-Service
. You will have to specify the name of a service.
The following command will display the startup type of Wecsvc
.
Get-Service Wecsvc | select -Property Name, StartType
Output:
Name StartType
---- ---------
Wecsvc Manual
Or, you can use the command below to get the startup type of Wecsvc
.
(Get-Service Wecsvc).StartType
Output:
Manual
If you want to know whether the service is running on the computer, you can also select the Status
property.
Get-Service Wecsvc | select -Property Name, Status, StartType
Output:
Name Status StartType
---- ------ ---------
Wecsvc Stopped Manual
As you can see, the Wecsvc
service is currently being stopped.
We hope this article helped you understand how to check the startup type of Windows services using PowerShell.