Posted February 6, 201213 yr I'm preparing an image for deployment so our developers can have a windows testing environment on their computers within a VM. I need this to be completely automated for future tasks as well. I'm having a few issues with joining the domain and changing the computer name though. Our naming convention needs to be host-win7vm Eg. Simon-win7vm We've developed a way to get the name through cmd so we don't need separate answer files for each computer. for /f "delims=" %a in ('c:\windows\system32\webfetch.exe websiteurl.php') do @set VMHOST=%a-win7vm This gets the host name from a website we set up and assigns it to the VMHOST variable and adds -win7vm to the end of the name. I've tried using WMIC to change the computer name as well but this gives me the "Unexpected switch at this level" error. for /f "delims=" %a in ('c:\windows\system32\webfetch.exe websiteurl.php') do @wmic computersystem where name="%COMPUTERNAME%" call rename name=%a Then I need to computer to join the Domain. This can be done by using NETDOM. NETDOM join %COMPUTERNAME% /domain:DOMAIN /UserD:USER /passwordD:PASSWORD However, as far as I understand, sysprep tries to join the domain before setting the computer name. Is there a way to reverse this? Continue reading...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.