simple script for restarting service

Welcome Forums General PowerShell Q&A simple script for restarting service

Viewing 0 reply threads
  • Author
    • #201930
      Topics: 2
      Replies: 0
      Points: 11
      Rank: Member


      I have one service which is running on server 2016 and this service needs to restart everyday in same excat time. To do this I have create basic ps  commands in order to achive mentioned. It is triggered by “task schedule” in Windows. Now problem is with errors which happens when job runs.

      this is error msg:

      “Task Scheduler did not launch task “\start script” because instance “{23c346c4-3c6c-4fa8-8bde-d242d71dbc05}” of the same task is already running.”


      PS  commands are:

      “Stop-Service -Name script-file-service -Force
      Start-Service -Name script-file-service ”


      can you please advise how to solve this?

      Thank you in advance

      ps begginer




Viewing 0 reply threads
  • You must be logged in to reply to this topic.