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

PowerShell: Detect Windows Version

This little snippet is reusable on many occasions where Windows version targeting is required. function…

How To Format HTML Content For Email

Major email service providers such as Google Gmail and Microsoft Office 365 have been supporting…

JavaScript: How to Extract Text From Contents of an External Web Page

What's the Challenge? There is a software security model that prevents scripts from an existing…