Just hit this one and I welcome any other insight.
Here is the code ----
$Cluster = "clustername"
$esxpass = "password"
$esxcheck = foreach ($vmhost in get-cluster -name $Cluster | get-vmhost | select Name) `
{Connect-VIServer -Server $vmhost.name -User root -Password $esxpass}
foreach ($vmhost in get-cluster -name $Cluster | get-vmhost | select Name) `
{disconnect-viserver $vmhost.name -confirm:$false}
Works fine on a 16 node cluster, but fails with the error on a 31 node cluster :smileycry:
Are you sure of that code ?
What exactly are you trying to do ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Are you sure of that code ?
What exactly are you trying to do ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yeah, the code is hardened. i use it in a VC migration script that we've used hundreds of times. this portion is going out and checking root password before moving on with the actual migration. we just now are using it on really large clusters. up until now it's only been used on 16 node clusters, max.
I adjusted the code to this and we're good. I'll have to look through the rest of the overall script for similar items.
foreach ($vmhost in get-cluster -name $Cluster | get-vmhost | select Name) `
{Connect-VIServer -Server $vmhost.name -User root -Password $esxpass
disconnect-viserver $vmhost.name -confirm:$false}
*I know the format is horrible