Restoring VM and changing computer name in OS

Casey T Cook 21 Reputation points
2021-01-19T18:01:35.793+00:00

I've restored a VM backup to a new VM using Recovery Services Vault. I restored it to an isolated vNet so that the computer wouldn't hijack the DNS entry. However, now I'm unable to RDP into the box. I'm attempting to change the ip config and computer name in the os (Windows Server 2016) via "Run Command" blade so that I can move it to a vNet that is on the domain. However, the powershell command "Rename-Computer -NewName "restoredvm" -Force" is failing with a message that it can't reach the domain.

Seems like I'm making this overly complicated. Is there a better way to restore a VM to a new VM instance and change the ipconfig/computer name at the same time so that the restored VM doesn't hijack the DNS entry from the original VM? I'm doing this to test disaster recovery.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,130 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 96,441 Reputation points MVP
    2021-01-19T18:26:28.427+00:00

    Related to the RDP issue:
    The restore of the VM was finished successfully?
    The restored VM is up and running?
    Is there a NSG associated to the isolated vNet/Subnet or/and the restored VM? If "yes" there is an "allow rule for RDP TCP Port"?
    Is a public IP associated with the VM?

    Regarding the renaming issue:
    It looks like a domain-joined computer can be renamed with Rename-Computer if a DC is available.
    To run your backup tests it would be helpful to have a restored AD in the isolated vNet/subnet as well.

    There was a similar question a few days ago:
    https://learn.microsoft.com/en-us/answers/questions/228266/how-to-restore-azure-vm-in-offline-mode.html

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten


1 additional answer

Sort by: Most helpful
  1. Manu Philip 16,971 Reputation points MVP
    2021-01-19T19:12:55.093+00:00

    I have posted an article in my blog with a different way of achieving the requirement
    quickly-clone-a-vm-in-azure

    0 comments No comments