We help IT Professionals succeed at work.

Add ESXi to LDAP/AD = Scripted?

Instead of Adding an ESXi host to the Active Directory manually below, is there a way to use powercli or other scripting languages to add the ESXi to the Domain/LDAP?

1.      Logon to the host or the vCenter Server using the FAT-Client
2.      From the Inventory menu – select Host and Clusters
3.      Select the Host you wish to Add to Active Directory
4.      Click the Configuration Tab
5.      Select Authentication Services from the left window pane
6.      Select properties link at the top right pane
7.      In the Directory Services Configuration dialog, select the directory service from the dropdown.
8.      Select Active Directory
9.      Enter a domain you wish to join            
a.      Example:          domain.local                (FQDN) NOT Netbios
b.      *** Please Note you must have permissions to join to domain ***
10.      Click Join Domain.
11.      Enter the user name (in user@domain.local format) and password of a directory service user account that has permissions to join the host to the domain
a.      Example:  user@domain.local
12.      Click OK.
13.      Click OK to close the Directory Services Configuration dialog box.
Comment
Watch Question

Co-Founder and Chief Architect
CERTIFIED EXPERT
Top Expert 2016
Commented:
Yes, powercli has that option.
Reference here.

Example:
$vmhost | Get-VMHostAuthentication | Set-VMHostAuthentication -JoinDomain -Domain "DomainName.com" -User "Username1" -Password "Password1"

Open in new window

Top Expert 2015

Commented:
Host profile has option too.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.