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...
Use single quotes if there are spaces.
Something like this
Get-VMHost -Name esx1.mydomain.test |
Set-VMHostAuthentication -Domain 'mydomain.test/ESXi Servers' -JoinDomain -Username "firstname.lastname@example.org" -Password "password"
This adds the ESXi host to the correct OU