T610 Wes7 set Hostname to Asset Tag (297 Views)
Reply
Collector
RGU_Admin
Posts: 5
Registered: ‎12-10-2013
Message 1 of 1 (297 Views)

T610 Wes7 set Hostname to Asset Tag

We too have had the annoying bug where some devices will pick up the hostname of the TC used to create the master image during the imaging process.  Based on the thread and soloution posted by tanelorn26  we have created a script to set the host name from the asset tag set in the BIOS.

 

Edit the _File and Registry template, add a Scipt sub-task.  Start in "C:\Windows\xpeagent\" and Run as "System".  Paste the code below into the Content section.

 

for /f "tokens=*" %%i in ('wmic systemenclosure get SMBIOSassettag /value ^|findstr "="') do set asset=%%i
set asset=%asset:~15%
echo %asset%
Hpdmmc set network hostname=%asset%

 

  We now have a template sequecnce that updates the BIOS if needed, deploys an image than runs the task created above to set the hostname.

 

I hope you find this useful and thanks to tanelorn26 for pointing us in the right direction.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.