I have the need to rename a non-ad computer that was just created with Hyper-V via Powershell scripts to a meaningful name before I connect it to the domain.
I have the local username and password to that computer.
I have tried Rename-Computer as well as a Netdom command, but none of them are working as I cannot remotely connect to the computer due to username and passwords, and Netdom only works for AD computers that are part of the same domain.
I see two possible ways to do this, and I would like guidance for either one:
1. Use some sort of PowerShell Command, perhaps Rename-Computer would work, I would just need to supply some non-network credentials?
2. Execute a script in the Hyper-V Guest computer on the first start up, but then how can I tell what the name of the Hyper-V Host is calling the Guest from within the Guest?
Please assist!
Edit: I found that in the Guest, I see the name of the machine in the registry, and I can get this to work, but only if I can somehow launch of the machine.