To add containers to AD domain it is sufficient to install domjoin-pvc-pool application template.
Download attached file
Unzip the content
Move domjoin-pvc-pool.efd to VIRTUOZZO_DIR\Templates\_cache folder, e.g. to D:\vz\Templates\_cache\
Deploy the template:
C:\>vzpkgdeploy -i domjoin-pvc-pool
Find join_domain.vbs in template folder, e.g. D:\vz\Templates\domjoin-PVC-Pool-20081205\root\join_domain.vbs
Edit the script and put correct credentials for user authorized to add computers to the domain:
strDomain = "VDI.LOCAL"
strUser = "USERNAME"
strPassword = "PASSWORD"
strAccountOU = "OU=Containers,DC=VDI,DC=local"
To add a container to the domain install the template to that container either using Parallels Virtual Automation, Parallels Management Console or command line tool:
vzpkgadd CTID domjoin-pvc-pool.
After you install the above template to a container that container will be joined to the domain and rebooted in 10 seconds.
NOTE: Since container is rebooted in 10 seconds after template installation, it is strongly recommended to install the template in the last turn, when all other templates are already installed. Otherwise installation of other templates may fail due to container restart.
join_domain.vbs script is based on the instructions given in the following Technet article