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..

The VMs can be created in bulk as shown in this post.

This script needs a running VM acting as DC and DHCP server as shown in this post.



2 responses

  1. Pingback: Setting up Hyper-V lab using Powershell | Sam's Corner

  2. Hello friends, its fantastic piece of writing on the topic of educationand completely explained, keep it
    up all the time.

    November 25, 2014 at 3:25 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.