PowerCLI Remove NTP and Add New NTP to ESXi Cluster

You have an ESXi cluster that has a mixed bag of NTP servers (messy).

Most PowerCLI scripts will add NTP servers but, not remove.  If they remove, you have to specify the old ones to remove.  In this case the cluster is so mixed with NTP servers, it would take more time to create the list to add to the script.

This interactive script will remove all NTP servers, add 2 new ones and restart the NTPD service.

This is a modification of https://www.kmruddy.com/2013/powercli-reset-ntp-settings-on-vmhosts-per-cluster/

 

Situation

You have an ESXi cluster that has a mixed bag of NTP servers (messy).

Most PowerCLI scripts will add NTP servers but, not remove.  If they remove, you have to specify the old ones to remove.  In this case the cluster is so mixed with NTP servers, it would take more time to create the list to add to the script.

This interactive script will remove all NTP servers, add 2 new ones and restart the NTPD service.

This is a modification of https://www.kmruddy.com/2013/powercli-reset-ntp-settings-on-vmhosts-per-cluster/

Script

[crayon-5ed23f851a10d165207521/]

 

Menu