PowerCLI

 View Only
  • 1.  Set-VMHostAuthentication how to specify a OU path with spaces

    Posted Oct 28, 2013 04:55 PM

    Hi all,

    There is a way to specify the OU where to force ESX to join AD by using the -Domain domain.com/OU1/OU2/OU3

    But I have not been able to to make it working with OU containing spacelike -Domain "MyDomain.com/My first OU/Second OU"

    Any Idea will be welcome...



  • 2.  RE: Set-VMHostAuthentication how to specify a OU path with spaces

    Posted Oct 28, 2013 06:59 PM

    Use single quotes if there are spaces.

    Something like this

    Get-VMHost -Name esx1.mydomain.test |
    Get-VMHostAuthentication |
    Set-VMHostAuthentication -Domain 'mydomain.test/ESXi Servers' -JoinDomain -Username "administrator@mydomain.test" -Password "password"

    This adds the ESXi host to the correct OU



  • 3.  RE: Set-VMHostAuthentication how to specify a OU path with spaces

    Posted Oct 29, 2013 09:15 AM

    I'm depressed:smileycry:... Can not make it working inside a script, while it works well from a command prompt...

    Powershell and strings has always been a grey area for me...



  • 4.  RE: Set-VMHostAuthentication how to specify a OU path with spaces

    Posted Oct 29, 2013 09:27 AM

    Perhaps attach your script so we can have a look ?



  • 5.  RE: Set-VMHostAuthentication how to specify a OU path with spaces

    Posted Oct 30, 2013 07:29 AM

    I'm more depressed :smileycry:... This whole story was just a typo on the long OU path we are using...

    Thks a lot to LucD for his always positive & quick feedback.