
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2039 Articles for Microsoft Technologies

845 Views
To stop the service using display name, use the parameter –DisplayName.For Example,PS C:\> Start-Service -DisplayName "Print Spooler" -Verbose VERBOSE: Performing the operation "Start-Service" on target "Print Spooler (Spooler)".You can also start the service with display name using,PS C:\> Get-Service -DisplayName "Print Spooler" | Start-Service -Verbose

2K+ Views
To stop the service which has dependent service in PowerShell -Force parameter is used. First, we will check what are the dependent services for specific service, to get them -DependentService parameter is used.ExampleFor example, WMI service (Name: Winmgmt) has multiple dependent services.Get-Service -Name Winmgmt -DependentServicesOutputtatus Name DisplayName ------ ---- ----------- Running UALSVC User Access Logging Service Stopped smstsmgr ConfigMgr Task Sequence Agent Stopped SepLpsService Symantec Endpoint Protection Local ... Stopped NcaSvc ... Read More

3K+ Views
To start a specific windows service, you need to use Start-Service command.ExampleStart-Service -Name SpoolerAbove command, will start the service name spooler. To check if service is started, use Get-Service –Name Spooler command.OutputStatus Name DisplayName ------ ---- ----------- Running spooler Print SpoolerThis command will not show the command progress. To check the command progress, use –Verbose parameter.PS C:\> Start-Service -Name Spooler -Verbose VERBOSE: Performing the operation "Start-Service" on target "Print Spooler (Spooler)".You can also start the service with, Get-Service -Name Spooler | Start-Service -Verbose PS C:\> Get-Service -Name Spooler | Start-Service -Verbose VERBOSE: Performing the operation "Start-Service" on target "Print Spooler ... Read More

25K+ Views
To stop specific service using PowerShell, you need to use Stop-Service command.SyntaxStop-Service -Name ServiceName Stop-Service -DisplayName ServiceDisplayNameExampleStop-Service -Name Spooler To check if service is stopped, type Get-Service -Name Spooler.OutputStatus Name DisplayName ------ ---- ----------- Stopped Spooler Print SpoolerYou can also use -Verbose parameter to check the command processes.PS C:\Windows\system32> Stop-Service -Name spooler -Verbose VERBOSE: Performing the operation "Stop-Service" on target "Print Spooler (spooler)".You can also perform the stop the service using, Get-Service -Name Spooler | Stop-Service -Verbose You can also use the wildcard ... Read More

2K+ Views
You can also use the WMI method to get the services information instead of standard command Get-Service.CommandTo get the service information on the server, you need to use WMI class Win32_Service.Get-WmiObject -Class Win32_ServiceOutputExitCode : 0 Name : Browser ProcessId : 0 StartMode : Manual State : Stopped Status : OK ExitCode : 0 Name : BTAGService ProcessId : 1468 StartMode : Manual State : Running Status : OK ExitCode : 0 Name : BthAvctpSvc ProcessId : 1460 StartMode : Manual State : Running Status : OK ExitCode : 0 Name : bthserv ... Read More

14K+ Views
To get service on the remote computer(s), simply you need to add parameter – ComputerName and provide remote servers computer name or IP address.In the below example, we are getting services information on remote computer Win7 which has Automatic start-type.Get-Service -ComputerName Win7 | Where{$_.StartType -eq "Automatic"}Similarly, you can connect multiple computers separated by comma (, ) in – ComputerName parameter.Get-Service -ComputerName Win7, TestPC | Where{$_.StartType -eq "Automatic"} If you need to identify on which particular computer(s), services exist, you can use the machinename property. In the above example, we are adding a machine name property in Pipeline.Get-Service -ComputerName Win7, TestPC ... Read More

617 Views
To filter out services with both start-type “Automatic” and Status “stopped” we need to use the -AND comparison operator. Here, services will be displayed only when both conditions are matching.CommandGet-Service | where{($_.StartType -eq "Automatic") -and ($_.Status -eq "Stopped")} | Select Name, StartType, StatusOutputName StartType Status ---- --------- ------ gpsvc Automatic Stopped gupdate Automatic Stopped MapsBroker Automatic StoppedCommandTo get services with start-type manual or disabled we will use -OR operator.Get-Service | where{($_.StartType -eq "Manual") -or ($_.StartType -eq "Disabled")} | Sort-Object Starttype | Select Name, StartType, StatusOutputLxpSvc ... Read More