10 Replies Latest reply on Apr 7, 2020 11:52 PM by scott28tt

    plan a task to restart a service like on all esx in vcenter

    CG21 Novice



      i think th title is preaty clear. We have a vcenter versin 6.7 with host on esxi server 6.7.0.

      i would like to plan a task to restart a service like ntp on all esx in this vcenter, i thnik yhere is 2 solutions :


      - a script which connects to each esx and which launches a service restart command like


      Connect-viserver vcenter1 -user root -pass password $report = foreach($esx in Get-VMHost){    Restart-VMHostService -HostService ( $_ | Get-VMHostService | Where { $_.Key -eq "ntpd" } ) }



      - or a planified task in vcenter but the option is not active i think because a can edit run a task but not add a task.



      what is your opinion and the possibilities ?


      Thank you