Setting OSDComputerName using CustomSettings.ini

5

Last week I got a call from a customer, that wanted to automate the naming of new computers, that was beeing deployed using System Center Configuration Manager. They were using the build-in UDI Wizard, that comes with the Microsoft Deployment Toolkit (MDT).

But the default computer name for new computers are “MININT-%SomeRandomNumber%”.

image

They want to use the following naming standard:

  • The first 3 characters should be static (The company prefix). In this example well use “ABC”.
  • The next character should be the Device type (D=Desktop, L=Laptop or V=Virtual Machine).
  • The last (up to) 9 characters should be the computer’s serial number

Example: ABC-V-A4G75GYL1

This kind of requirement something that almost every customers has, so it was pretty easy for me to provide the solution. But from time to time I get questions about this, so I thought I’d share the solution here.

Here is the CustomSettings.ini file that we used to solve this requirement:

[Settings]
Priority=Init, ByDesktop, ByLaptop, ByVirtual, Default
Properties=MyCustomProperty,ComputerSerialNumber, ComputerTypeName

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

[ByLaptop]
Subsection=Laptop-%IsLaptop%

[ByDesktop]
Subsection=Desktop-%IsDesktop%

[ByVirtual]
Subsection=Virtual-%IsVM%

[Laptop-True]
ComputerTypeName=L

[Desktop-True]
ComputerTypeName=D

[Virtual-True]
ComputerTypeName=V

[Default]
OSDComputerName=DNK-%ComputerTypeName%-%ComputerSerialNumber%

After updating the CustomSettings.ini file and the updated the Distribution Point’s, this was the new default behavior:

image

That’s it…

Enjoy.

+Ronni Pedersen

About Author

My name is Ronni Pedersen and I'm currently working as a Cloud Solution Architect at EG A/S in Denmark. My primary focus is Enterprise Client Management solutions, based on technologies like AzureAD, Intune, EMS and System Center Configuration Manager. I'm is also a Microsoft Certified Trainer and Microsoft MVP in Enterprise Mobility.

5 Comments

  1. why have you got DNK is that not meant to be ABC

    [Default]
    OSDComputerName=DNK-%ComputerTypeName%-%ComputerSerialNumber%

  2. Great information– thanks for the share! I was wondering if you could help by providing some basic directions as to where to put the CustomSettings.ini file to replace the MININT naming scheme? Also, in this case your customer used a static prefix to represent the company name. In my environment, we use dynamic prefixes based on the division, but otherwise our naming convention is exactly the same. I was hoping you wouldn’t mind helping me to modify the settings so that I can allow modification of the prefix– for example we use TEC for technology division, CCC for our Call Center, etc. I made an initial attempt which I could provide but I’d like to have some confirmation that it’s done properly before making any changes to our configuration. Anyways thanks again for your contribution and please continue the good work!

    • The CustomSettings.ini file is generated automatically when you create a new MDT Task Sequence.
      It simply just a text file in a folder (Package).
      You can specify dynamic names by using “roles” with the MDT database. You need something to tell what role a computer should be a member of.

  3. Mohammed Shariff on

    Hello thr,
    Please help with below requirement.
    If Desktop assign SYS prefix and four digits number example SYS0001
    If Lapto assign LAP prefix and four digits number example LAP0001 and if computer name is already available in AD then assign SYS002 / LAP002 based on device type laptop r desktop.

Leave A Reply