Join domain to a specific OU for guest operating system customization.
search cancel

Join domain to a specific OU for guest operating system customization.

book

Article ID: 344233

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

Guest customization does not support joining the domain with a specific OU.

 

Environment

VMware vSphere ESXi 7.0.x
VMware vSphere ESXi 6.7
VMware vCenter Server 6.7.x
VMware vCenter Server 6.5.x
VMware vSphere ESXi 6.5
VMware vCenter Server 7.0.x

Resolution

Guest customization doesn't support joining the domain with a specific OU. As a workaround, the user could add a command in the specification "Commands to run once" to help join the domain with the given OU.


Workaround:

Please follow the below steps to join the domain to a specific OU.

  1. Create a Windows VM customization specification
  2. In "Commands to run once" tab, add command:
    netdom join <computername> /d:<Domain> /ou:<OUPath> /userd:<User> /pd:<Password> /reboot <delay>

    Please refer to Netdom Join for command syntax

    Example:
    netdom join myPC /domain:example.com /OU:OU=ABC,DC=example,DC=com /UserD:example\administrator /PasswordD:xxxxxx /reboot 60
  3. In the "Administrator password" tab, check the checkbox "Automatically logon as Administrator" and set "Number of times to logon automatically" to an integer >= 1
  4. Save and execute the guest operating system customization. The VM will join the specific OU successfully.

    Note: 
    User must ensure "Automatically logon as Administrator" works properly since the run once command only runs after logon. The GPO settings or EAS password restrictions might cause automatically logon to fail. For details please check: Turn on automatic logon in Windows