Powershell script to rename many computers and join them to AD domain
This script will go through all VMs on the current Hyper-V host, select those that match a given name pattern, rename them to match the VM Name (in Hyper-V), and join them to the domain.
The script can be downloaded from the Microsoft TechNet Gallery.
The script leaves a log file in the folder where it runs that shows details of actions performed and their success/failure status.
In the V1.1 update, I added code to initialize and format VM disks..
This script needs a running VM acting as DC and DHCP server as shown in this post.