Renaming OSD target's hostname based on Chassis type during or after post OS deployment

Is there a proper way of accomplishing the following?

  • One Baremetal Profile (Win10 image)
  • Has configuration to join to a specific domain OU
  • Hostname depends on the chassis type…

For example, if computer is a desktop computer:
the Hostname format would be:
DESKTOP-[SN]

If computer is a laptop:
the Hostname format would be:
LAPTOP:[SN]

Or is the correct way is to create multiple profiles from a Win10 image and select the profile which matches the system you are PXE booting.

Any thoughts?
Thank you.

Hello.

This should possible with an advanced customization of a single bare metal profile, after completing to fill its wizard tab (because editing the manual tab will disable the wizard tab), editing the manual tab so to configure the hostname based on the computer type. I report here an example. The manual tab follows the syntax of Microsoft CustomSettings.ini, if changes or insights are needed.
I don’t report the [Default] section because its content has been left as is, while the other sections should be added or modified as follows:

[Init]
ComputerSerialNumber=#Right(“%SerialNumber%”,7)#

[ByLaptop]
Subsection=Laptop-%IsLaptop%

[ByDesktop]
Subsection=Desktop-%IsDesktop%

[Laptop-True]
TypeCode=Laptop

[Desktop-True]
TypeCode=Desktop

[ComputerNameConf]
OSDComputerName=%TypeCode%-%ComputerSerialNumber%

[Settings]
Priority=Init, ByLaptop, ByDesktop, ComputerNameConf, Default
Properties=OSDPREFIX, BFClientVersion, BFClientFileName, ComputerSerialNumber, TypeCode

I also truncated the serial number to 7 character to not exceed the limit of 15 characters in the windows hostname.
Thanks.

Sergio – HCL BigFix – Lifecycle Team

Hi,

Thanks for your response. That lead me to the right direction :slight_smile:

I tried adding that in manual section considering the default section are also added. But I got this error

Windows could not parse or process unattend answerfile [C"\windows\Panther\unattend.xml] for pass (specialize). The answer file is invalid

I just figure out that the issue was due to the fact that I’m doing the PXEboot on a virtual machine and the chassis type won’t work for that virtual test machine I had.

Thank you so much!

[Init]
ComputerSerialNumber=#Right(“%SerialNumber%”,7)#

[ByLaptop]
Subsection=Laptop-%IsLaptop%

[ByDesktop]
Subsection=Desktop-%IsDesktop%

[ByVirtual]
Subsection=Virtual-%IsVM%

[Laptop-True]
TypeCode=Laptop
OSDComputerName=%TypeCode%-%ComputerSerialNumber%

[Desktop-True]
TypeCode=Desktop
OSDComputerName=%TypeCode%-%ComputerSerialNumber%

[Virtual-True]
TypeCode=Virtual
OSDComputerName=%TypeCode%-TEST

[Settings]
Priority=Init, ByLaptop, ByDesktop, ByVirtual, Default
Properties=OSDPREFIX, BFClientVersion, BFClientFileName, ComputerSerialNumber, TypeCode

2 Likes