Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create a template in ESX that I can automate with PowerCLI. Everything works great so far, but because I have some specific settings, I had to create my own sysprep.inf. Now, the computername and the VM guest name are out of synch. I need to automate this for a sandbox enviornment, so I will constantly be deleting and rebuilding boxes. Thus, I need the VMhost name and the computername to be the same. Am I missing something?

share|improve this question
Have you considered using an MDT deployment instead? – Jim B Nov 16 '15 at 19:49

While I'm not sure it's still relevant to the OP, it might be relevant to others. As johnshen64 stated, we can modify the OSCustomizationSpec to set the computer name. We can do it by using the NamingPrefix and the NamingScheme parameters.


New-OSCustomizationSpec -Name specName -NamingScheme Fixed -NamingPrefix hostname

will create a new specification named specName which will set the name of the VM to hostname.

Reference: New-OSCustomizationSpec

share|improve this answer

You can modify the vm with OSCustomizationSpec to set the computer name to the vm name.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.