PowerCLI

  • 1.  Set-VMHostAuthentication

    Posted Aug 28, 2012 12:04 PM

    Hi all,

    i'm scripting to set up a new ESXi5...works fine so far, but i can't join the ESXi to a Windows ActiveDirectory 2008 Domain.

    This is what i'm trying:

    get-vmHost ESXi01 | Get-VMHostAuthentication | Set-VMHostAuthentication -Domain $domain -JoinDomain:$true -Credential $global:vCred -Force:$true -Confirm:$false


    and this is the output:

    Set-VMHostAuthentication : Der Parametersatz kann mit den angegebenen benannten Parametern nicht aufgelöst werden.

    Bei C:\Users\LB025304\Documents\PowerShell\Configure-ESXi_LEW_Trunk.ps1:998 Zeichen:70

    + $global:vmHost | Get-VMHostAuthentication | Set-VMHostAuthentication <<<< -Domain $domain -JoinDomain:$true -Credent

    ial $global:vCred -Force:$true -Confirm:$false

    + CategoryInfo : InvalidArgument: (:) [Set-VMHostAuthentication], ParameterBindingException

    + FullyQualifiedErrorId : AmbiguousParameterSet,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.SetVMHostAuthenticat

    ion


    I know this worked sometimes, but doesn't anymore...

    Any suggestions?

    Thanks!



  • 2.  RE: Set-VMHostAuthentication

    Posted Aug 28, 2012 01:14 PM

    I am not too sure what might have gone wrong here considering you had it worked in the past. I can only recommend debugging.

    Have a look at this link for comparison:  http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Set-VMHostAuthentication.html



  • 3.  RE: Set-VMHostAuthentication

    Posted Aug 28, 2012 01:20 PM

    Is the user mentioned in $global:vcred still authorized to join other objects to domain ?

    Greg



  • 4.  RE: Set-VMHostAuthentication

    Posted Aug 28, 2012 01:22 PM

    yes, this account is member of Domain-Admins...



  • 5.  RE: Set-VMHostAuthentication
    Best Answer

    Broadcom Employee
    Posted Aug 28, 2012 03:01 PM

    Hi,

    This particular error is caused by the Force parameter. It's applicable only for LeaveDomain parameterSet but in this case you are in the JoinDomain parameterSet. So just remove the

    -Force:$true

    and try the command again.

    Regards,

    Yasen



  • 6.  RE: Set-VMHostAuthentication

    Posted Aug 30, 2012 07:56 AM

    Thanks, Yasen.

    That's it!