B
B
belotooth2022-02-06 20:40:27
PowerShell
belotooth, 2022-02-06 20:40:27

How to clone a virtual machine in a domain N times?

I'm not a sysadmin, but I need to deal with such a problem.
There is a Windows 10 virtual machine named computer1 in the test.local domain (on Windows Server 2019). You need to clone it N times and get machines: computer2, computer3, ... computerN.
I just tried to clone, but then there are problems when logging in, as I understand it, because the account is still the only one on the domain. I tried the Rename-Computer
command through powershell , while the computer name changes, and the accounts on the domain too. And how to create automatically a new account for the second and other computers? The Add-Computer command says that the computer is already in the domain. Although she has the -NewName key, I thought it might help somehow, but no.
To begin with, I want to understand the algorithm in general, how to do it correctly and optimally, and then I need to automate it somehow. you need to clone a lot of machines, hands are not an option. Tried googling but couldn't find anything useful.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MaxKozlov, 2022-02-06
@MaxKozlov

The machine at the time of cloning in the domain should not be.
And then -
one of the options - sysprep with a response file
second - Poweshell DSC
Third - your own script that will log in to the machine, rename it and enter it in the house using Add-Computer :)

A
Alexey Dmitriev, 2022-02-06
@SignFinder

You understood everything correctly, you need to run sysprep on the cloned machine and re-enter it into the domain with a unique name.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question