Services Script

Howdy guys!

Hope you are all doing well. I have a question about services. I have this set of condition below and I was able to do number 1 but having difficulties with 2-4. Sorry just starting out, trying to practice just started college and have a few assignments :frowning:

  1. If any or all of the services that start with letter “W” are running, stop them

  2. If confirm that all the services are stopped, reboot the computer

  3. Verify if the computer successfully reboot

  4. Verify if all the services are running after reboot

Thanks for your help!

Hi, I dont want you to provide full code-blocks. But I can give you some Informations where you can have to go deeper.

  1. Get the Status of the Services, three hints: Get-Service, Status, Where
  2. Grab the Last boot time from an CIM-Instanc, two hints: Get-CimInstance, LastBootUptime
  3. Do the same like in step 2

Hope, that will help you out.
If you have some code, we can go further with this, but some of the task you have to do :slight_smile:


Thanks BLackbox let me get on with it then! :slight_smile:

Will get back once I have constructed the code.