5. vCloud vApp Provisioning : 5.5 Workflow Overview : 5.5.3 Loop Through Each VM in vApp : 5.5.3.4. Add Specified Domain\User to Local Administrators Group
   
5.5.3.4. Add Specified Domain\User to Local Administrators Group
You can use the guest OS customization script to add a domain\user account to the Local Administrators group of Windows virtual machines that are joined to a domain.
To add a domain\user account to the Local Administrators group of Windows virtual machines that are joined to a domain
1. Configure the VCD organizations to Enable domain join for virtual machines in this organization, specifying appropriate domain and credentials.
2. Specify the domain in full format, such as vmware.com, rather than the NetBIOS form of vmware. This setting is located under the Organization > Administration > Settings > Guest Personalization page of the vCloud Director UI.
3. Prepare the vApp template with one or more Windows virtual machines that have had the Guest OS Customization tab of their properties properly populated. Use the following settings:
*Enable guest customization – Selected.
*Change SID – Selected.
*Password Reset – As desired.
*Join Domain – Populated as desired using either the domain configured for the organization or specified domain and credentials.
*An appropriately formatted customization script. The following is a sample used in a custom workflow:
if '%1%' == 'postcustomization' (net localgroup administrators
@domain@\\@username@ /add)
The variables @domain@ and @username@ are replaced at workflow execution time. For scripting details, see the VM Customization scriptable task of the sample workflow.