Deployment Solution

 View Only

Applying Computer Names Based on MAC Using GSS Tool GHConfig 

Dec 11, 2008 11:22 AM

If you use GhostCast server to restore multiple machines, Ghost walker can change the computer names in a limited way to avoid duplicate computer names in Windows. Now you can use ghconfig with little bit of scripting to apply computer names from PreOS, and it is more flexible than Ghost walker. For most of the configuration changes, you need not the Ghost Client installed in the system. Depending on your environment, this method could be used with Console tasks too to apply arbitrary computer names instead of prefix-id based computer names.

This process is easier in WinPE than DOS since WinPE supports VBScript. For DOS you need to use a scripting tool such as AWK. Other than that, in WinPE you can get the MAC address using WMI (or ipcofig) but in for DOS you need to have a tool to get the MAC address when a packet driver is installed. This download contains a small utility, getmac.exe (thanks to Nigel Bree), that can read the MAC when a packet driver is installed.

Using a file containing MAC addresses and Computer names, a script can generate a configuration file with the required computer name, and GHConfig (in DOS) or GHConfig32 in PE can apply it to the newly cloned disk.

This is what you need to do.

  1. Create a text file with MAC address and computer names.
      11-11-11-11-11-11 TestComp1
      11-11-11-11-11-22 Test2
      11-11-11-11-11-33 user-1
  2. After cloning the machine, use a script to get the MAC of the machine and find the computer name from the text file. Create a configuration file and name it ghregupd.reg

    For example, machine with MAC 11-11-11-11-11-33

    CONFIG_COMMANDS COMPUTERNAME = "user-1" "user-1" DNSHOST = "user-1" "user-1" END_CONFIG_COMMANDS
  3. Run "ghconifg /a" if running from DOS or "ghconfig32 /a" if running from WinPE. This will apply the name in the configuration file. Switch "/a" is for ghconfig to find the Windows installation automatically. More information on GHConfig is given in GSS manual. For name change, you do not need to have the Ghost Client installed in the machine.


Attached download has sample scripts for both DOS and WinPE. Please note that this is not a supported process but a workaround only, and the attachments are provided as examples. You need familiarity with scripting techniques to use this method, and need to change the scripts to suit your environment.

Running from WinPE

If you are running this from Console, create and execute a task to

  1. Clone
  2. Do not select Configuration
  3. File Transfer to Ghost partition and transfer the text file, script and batch file to X:\Ghost folder
  4. Command Execution in Ghost partition to execute X:\Ghost\applycfg.bat. Remember to ask it to wait till the command is completed

Since it uses WMI to get the MAC, use WinPE-512. If not, you can change the script to use output of ipconfig.

If the image is restored using GhostCast server

  1. Make text file, script and batch file and ghconfig32.exe available in your ProOS disk in the same folder.
  2. In the example, batch file assumes it is running from X:\ghost. You will have to update the applycfg.bat to reflect the drive/folder you use.
  3. WinPE should include WMI support unless you change the script to use ipconfig to get MAC.
  4. Call the batch file.

Running from DOS

Example uses AWK script. Other than the files included in this download you need to download AWK.exe for DOS.

If you are running this from Console, create and execute a task to

  1. Clone
  2. Do not select Configuration
  3. Transfer all the files in DOS folder in the download and AWK.exe to GhostPartition
  4. Execute incoming\ Ghost Partition (Remember, when transferring files to Ghost partition under DOS they go to Ghost\incoming folder. Command executions happen from Ghost folder). Select the command execute to wait till the command is completed

If you do not use Console

  1. Make all the files available in the same folder, copy ghconfg.exe and awk.exe too to that folder.
  2. Update the batch file based on the instructions in the file.
  3. Call it after imaging operation.
License:Altiris EULA
By downloading this software, you agree to the terms and conditions in the Altiris End User License Agreement
Support:User-contributed tools on the Juice are not supported by Altiris Technical Support. If you have questions about a tool, please communicate directly with the author by visiting their profile page and clicking the 'contact' tab.

0 Favorited
2 Files
jpg file
6550.jpg   2 KB   1 version
Uploaded - Feb 25, 2020
zip file   122 KB   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Related Entries and Links

No Related Resource entered.