5 Easy steps to register your cloned amazon ec2 server to your domain via AWS SSM

Sometime you may require to get a clone of your windows ec2 instance on AWS which was already registered with your domain. But this new cloned instance will not get added to the domain (Microsoft Active Directory / AWS Simple AD) it self. There are few tweaks that you need to follow up in order to get this done.

Prerequisites – In order to work with AWS Systems Manager you’ll need to create a role with iam permissions to access AWS SSM and attach it to your instance.

Step 1

Login to you AWS account and go for AWS Systems Manager. From there select “Session Manager” and then click on “Start Session”

Step 2

Now from the next window you’ll get to search your cloned instance. Here I’ve searched it with the instance ID and then click on “Start Session”.

Step 3

Your session will get start in a new console, now you can run below command to remove the cloned server from domain.

netdom remove <current_hostname_of_instance> /Domain:<domain_name> /UserD:<admin_username> /PasswordD:"<admin_password>" /Force

As you can see in the output now you’ll need to restart the server.

Step 4

Once server is restarted follow step 1 – step 2, then run the following command to update your hostname to a new one.

netdom renamecomputer <current_hostname_of_instance> /newname:<new_hostname_of_instance>

Step 5

Finally now it’s time to register your cloned instance back to the domain as new instance. Run the following command and reboot the instance again.

netdom join <new_hostname_of_instance> /Domain:<domain_name> /UserD:<admin_username> /PasswordD:"<admin_password>"

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.

Website Powered by WordPress.com.

Up ↑

%d bloggers like this: