Services Script

This topic contains 2 replies, has 2 voices, and was last updated by  Brad Feath 1 year, 3 months ago.

  • Author
  • #62958

    Brad Feath

    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 🙁

    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!

  • #62959


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

    2. Get the Status of the Services, three hints: Get-Service, Status, Where
    3. Grab the Last boot time from an CIM-Instanc, two hints: Get-CimInstance, LastBootUptime
    4. 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 🙂


  • #62977

    Brad Feath

    Thanks BLackbox let me get on with it then! 🙂

    Will get back once I have constructed the code.

You must be logged in to reply to this topic.