locked
Computer name for the WinPE RRS feed

  • Question

  • I'm trying to make a tool my technicians can use to create a backup image for an existing machine.

    What I thought of was using a BAT that I could inject into my Boot images and run some really simple DISM command:

    Dism /Capture-Image /ImageFile:D:\%computername%.wim /CaptureDir:C:\ /Name:"Captured Image"

    Problem is the %computername% to name the WIM keeps comming up as MINWINPC.wim. It's not even the MININT-xxxxxx computer name that WinPE generates. 

    Maybe I'm not using the command correctly, but is there a way I can make the computer name something identifiable, like the computer's serial #?

    Wednesday, March 4, 2015 6:05 PM

Answers

  • One way to get around this is to load the registry of the offline computer in WinPE and get the computer name from there. Computer names are stored in HKLM\System\CurrentControlSet\Control\ComputerName\ComputerName and the value ComputerName.

    You can find instructions for loading the offline computer's registry hive here:

    http://superuser.com/questions/636055/how-to-modify-a-computers-offline-registry-from-winpe

    Otherwise, you could have the script prompt for the computer name and the tech can manually enter it in.

    • Proposed as answer by Narcoticoo Wednesday, March 4, 2015 6:59 PM
    • Marked as answer by Daniel JiSun Wednesday, March 18, 2015 5:20 AM
    Wednesday, March 4, 2015 6:50 PM
  • Another possibility is to simply query WMI for the serial number and use that instead of %computername%.

    Jason | http://blog.configmgrftw.com | @jasonsandys

    • Marked as answer by Daniel JiSun Wednesday, March 18, 2015 5:20 AM
    Wednesday, March 4, 2015 7:19 PM
  • Just throwing this out. . .if ConfigMgr is integrated with MDT, there is a ztibackup.wsf script that can be used for backing up to a WIM file.  In one case I have seen a task sequence created that utilizes that script along with a custom *.wsf that prompts for a computer name and stores it in a variable.  The WIM is then named according to the manually entered computer name.

    That TS is then deployed to a collection and devices are added to it as needed.

    Just another take on your use case.

    Jeff

    • Marked as answer by Daniel JiSun Wednesday, March 18, 2015 5:20 AM
    Wednesday, March 4, 2015 7:25 PM

All replies

  • One way to get around this is to load the registry of the offline computer in WinPE and get the computer name from there. Computer names are stored in HKLM\System\CurrentControlSet\Control\ComputerName\ComputerName and the value ComputerName.

    You can find instructions for loading the offline computer's registry hive here:

    http://superuser.com/questions/636055/how-to-modify-a-computers-offline-registry-from-winpe

    Otherwise, you could have the script prompt for the computer name and the tech can manually enter it in.

    • Proposed as answer by Narcoticoo Wednesday, March 4, 2015 6:59 PM
    • Marked as answer by Daniel JiSun Wednesday, March 18, 2015 5:20 AM
    Wednesday, March 4, 2015 6:50 PM
  • Another possibility is to simply query WMI for the serial number and use that instead of %computername%.

    Jason | http://blog.configmgrftw.com | @jasonsandys

    • Marked as answer by Daniel JiSun Wednesday, March 18, 2015 5:20 AM
    Wednesday, March 4, 2015 7:19 PM
  • Just throwing this out. . .if ConfigMgr is integrated with MDT, there is a ztibackup.wsf script that can be used for backing up to a WIM file.  In one case I have seen a task sequence created that utilizes that script along with a custom *.wsf that prompts for a computer name and stores it in a variable.  The WIM is then named according to the manually entered computer name.

    That TS is then deployed to a collection and devices are added to it as needed.

    Just another take on your use case.

    Jeff

    • Marked as answer by Daniel JiSun Wednesday, March 18, 2015 5:20 AM
    Wednesday, March 4, 2015 7:25 PM