Posted On August 30, 2019

PowerShell: Quickly Start Services that were Set to Auto

kimconnect 0 comments
blog.KimConnect.com >> Codes >> PowerShell: Quickly Start Services that were Set to Auto
Quick Liners:
# Command to check
Get-WmiObject -ClassName Win32_Service -Filter "StartMode='Auto' AND State<>'Running'" | Format-Table -Auto DisplayName,Name,StartMode,State

# Command to start those non-running services
Get-WmiObject -ClassName Win32_Service -Filter "StartMode='Auto' AND State<>'Running'" | Start-Service
Sample Output:
[sherver007.something.loco]: PS C:\Users\176233\Documents> Get-WmiObject -ClassName Win32_Service -Filter "StartMode='Auto' AND State<>'Running'" | Format-Table -Auto DisplayName,Name,StartMode,State

DisplayName Name StartMode State
----------- ---- --------- -----
Downloaded Maps Manager MapsBroker Auto Stopped
Remote Registry RemoteRegistry Auto Stopped
Software Protection sppsvc Auto Stopped
Windows Biometric Service WbioSrvc Auto Stopped

[sherver007.something.loco]: PS C:\Users\176233\Documents> Get-WmiObject -ClassName Win32_Service -Filter "StartMode='Auto' AND State<>'Running'" | Start-Service
# output = silent

[sherver007.something.loco]: PS C:\Users\176233\Documents> Get-WmiObject -ClassName Win32_Service -Filter "StartMode='Auto' AND State<>'Running'" | Format-Table -Auto DisplayName,Name,StartMode,State
# output = de nata

Leave a Reply

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

Related Post

Basic JavaScript: Understand String Immutability

// Setupvar myStr = "Jello World";// Only change code below this linemyStr[0] = "H"; //…

PowerShell: Add Local Group Members Onto a Server List

Sometimes, the GUI method of accomplishing tasks is too arduous and error prone. Thus, these…

PowerShell: Windows Systems Inventory

<# Systems-Inventory.ps1 Version: 0.04 Purpose: to generate a report with information about servers on the…