The following script will update the syslog server of all Esxi hosts in a specific cluster
Two variables you’ll need to edit are $ClusterName and $SysLogSvr
# Variables
$ClusterName = "MyCluster"
$SysLogSvr = "udp://10.10.10.11:514"
$Cluster = Get-Cluster -Name $ClusterName
# Loop through each host and set syslog
foreach ($VMHost in ($Cluster | Get-VMHost ) ) {
set-VMHostSysLogServer -VMhost $VMHost -SysLogServer $SysLogSvr
}