To clarify, I'm running vCenter 4.1 U1 w/ ESXi 4.1 U2 hosts currently.
Maybe the hosts aren't reflecting their connection state correctly?
I do get the following error when I do a Get-VMHost Authentication on a vCenter 5 with an ESX 4.1U1 that is in maintenance mode.
Get-VMHostAuthentication : 13-03-2012 07:13:50 Get-VMHostAuthentication The host must be in the following state: Connected.
This works from the vSphere Client and the JoinDomain_Task method, so I suspect this is an obsolete requirement.
As a bypass you could use the script from my Script vSphere 4.1 AD Authentication post.Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
Thanks guys, we will take a look at this for a future version
I bypassed it by simply doing the domain join as a first step rather than a last step, changing it to connect status and different placement in vCenter.
Then just placing it back into maintenance.
I got same error when retrieve authentication from ESXi5.0 U1 in vCenter 5.0 with PowerCLI 5.0.
Error message below for your reference.Get-VMHostAuthentication : 7/24/2012 5:43:06 PM Get-VMHostAuthentication The host must be in the following state: Connected.At line:1 char:25+ Get-VMHostAuthentication <<<< -VMHost dcaesx57.amat.com+ CategoryInfo : InvalidOperation: (Maintenance:VMHostState) [Get-VMHostAuthentication], ViError+ FullyQualifiedErrorId : Common_SharedParameterHelper_VerifyVmHostState_HostNotInState,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetVMHostAuthenticationhttp://www.zhengwu.org