Flapoly
Contributor
Contributor

Set-VMHostAuthentication how to specify a OU path with spaces

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...

0 Kudos
4 Replies
LucD
Leadership
Leadership

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

ad-esxi.png


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Flapoly
Contributor
Contributor

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...

0 Kudos
LucD
Leadership
Leadership

Perhaps attach your script so we can have a look ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Flapoly
Contributor
Contributor

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.

0 Kudos