8 Replies Latest reply on Apr 10, 2020 12:20 AM by CG21

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

    CG21 Enthusiast

      Hi,

       

      i think the title is preaty clear. We have a vcenter versin 6.7 with multiple 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 have this script, is it ggod for you ?

       

       

      Connect-viserver vcenter1 -user vcenter -pass password

      foreach($esx in Get-VMHost){   

      Restart-VMHostService -HostService ( $_ | Get-VMHostService | Where { $_.Key -eq "ntpd" } )

      }