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%”.
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
Priority=Init, ByDesktop, ByLaptop, ByVirtual, Default
Properties=MyCustomProperty,ComputerSerialNumber, ComputerTypeName
[Init]
ComputerSerialNumber=#Right(“%SerialNumber%”,9)#
ComputerSerialNumber=#Right(“%SerialNumber%”,9)#
[ByLaptop]
Subsection=Laptop-%IsLaptop%
Subsection=Laptop-%IsLaptop%
[ByDesktop]
Subsection=Desktop-%IsDesktop%
Subsection=Desktop-%IsDesktop%
[ByVirtual]
Subsection=Virtual-%IsVM%
Subsection=Virtual-%IsVM%
[Laptop-True]ComputerTypeName=L
[Desktop-True]
ComputerTypeName=D
ComputerTypeName=D
[Virtual-True]
ComputerTypeName=V
ComputerTypeName=V
[Default]
OSDComputerName=DNK-%ComputerTypeName%-%ComputerSerialNumber%
OSDComputerName=DNK-%ComputerTypeName%-%ComputerSerialNumber%
After updating the CustomSettings.ini file and the updated the Distribution Point’s, this was the new default behavior:
That’s it…
Enjoy.
link from : https://www.ronnipedersen.com/2014/10/setting-osdcomputername-using-customsettings-ini/
No comments:
Post a Comment