Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How would you programmatically report which Windows Services are not running?

Given:

  • PowerShell 5.1 or above
  • Cmdlet Get-Service
  • Windows OS
  • Windows Services

How would you programmatically report if a Window Services is Stopped?

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

If you want to start them all, use the Where-Object cmdlet to filter the list of services so you only get those that:

  • Are not running, and
  • Are not disabled

Then pipe the resulting set of services to Start-Service:

Get-Service |Where-Object Status -ne Running |Where-Object StartType -ne Disabled |Start-Service
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading