VMware Horizon Community
jazcuy
Contributor
Contributor

OU placement for VDI

I know that using standard Sysprep methods, it is possible to automatically place new machines in a specific OU, but is anyone able to do this using just the VC Template and Configuration Wizard in conjunction with VDM?

Thanks

20 Replies
Sebastian_Schwa
Contributor
Contributor

We found this topic very helpful, we tried some and found out a solution to move the machine-account.

Edit the bold words to match your configuration.

1) Download psexec to your template to c:\,

2) create a dsmove.cmd in c:\ with the following content to avoid windows security warning for psexec.exe:

( \ \domaincontroller must be without the blankspace, but this forum uses double-backslash as new line)

C:\psexec.exe /accepteula \ \Domaincontroller.domain.topleveldomain -u domain\administrator -p password cmd.exe /c dsmove.exe CN=%computername%,CN=Computers,DC=Domain,DC=topleveldomain -newparent OU=view-clients,DC=domain,DC=topleveldomain & exit

3) create a runonce.cmd in c:\ with the following content:

cmd.exe /c c:\dsmove.cmd

del /Q /F c:\dsmove.cmd

cmd.exe /c shutdown -r -t 01

4) Use this commands in the run once section of the customization rule, combined with login as admin once:

cmd.exe /c c:\runonce.cmd

This will edit the OU of your new VM and delete the local script c:\dsmove.cmd from the machine, since there is the admin password stored in clear text.

in our DemoCenter the script c:\dsmove.cmd had the following content for example:

C:\psexec.exe /accepteula \ \dc.indasys.demo -u indasysdemo\administrator -p password cmd.exe /k c:\dsmove.exe CN=%computername%,CN=Computers,DC=indasys,DC=demo -newparent OU=view-clients,OU=IndasysDemo,DC=indasys,DC=demo & cmd.exe /c shutdown -r -t 01 & exit