VMware Cloud Community
Guv
Enthusiast
Enthusiast

Script for adding virtual desktops to the domain.

In creating a vmware view pool on 4.6, i am creating customization spec, for the pool, and in the run once, step i want to add a script which will add this virtual desktop to our domain based on a template which is already on the domain,

Is there any scripts i can use which will add the computer account to the domain and add it in a specific OU.   Possibly based on powershell.

Has anyone done a script which works, can anyone provide me one.

Thanks

0 Kudos
2 Replies
LucD
Leadership
Leadership

Isn't the customizationspec doing the join to the domain  (defined in the Workgroup or Domain section) ?

In any case, you can join a station to the domain with the netdom command.

Something like this

netdom join %computername% /domain:MyDomain /userd:MyUser /passwordd:MyPswd


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
BostonTechGuy
Enthusiast
Enthusiast

I am adding hundreds of VMs to a domain as we speak.  I am using PowerCLI for a lot of customization (static IPs, Names, etc etc).  However all my domain access is built directly into the Custom Script on the vCenter.  All its doing is calling the correct parameter in SYSPREP for you.  Pretty simple, it works and I am not messing with it Smiley Happy.  Highly recommend keeping the domain access and creds to the Custom Script Manager in vCenter.

As for adding the server to the correct OU, this would have to happen once the VM was completed.  I recommend reviewing this article from Microsoft:

http://blogs.technet.com/b/heyscriptingguy/archive/2012/03/01/the-easy-way-to-use-powershell-to-move...

Thanks,

BostonTechGuy

0 Kudos