ConfigMgr SCCM Dynamic Computer Naming in Zero Touch Deployments. Yet another great post from DeploymentGuys !!!
I have been meaning to write up a solution around dynamic computer naming in Zero Touch for a while. Many people have emailed or commented on how useful this would be – so here goes.
ConfigMgr SCCM Dynamic Computer Naming in Zero Touch Deployments
Zero Touch Installation relies on a combination of System Centre Configuration Manager (ConfigMgr) and Microsoft Deployment Toolkit (MDT) 2010/2012. The MDT guys wrote a great integration tool that gives the ability to add extra functionality to ConfigMgr, such as new tasks, task sequence templates, and a new wizard for creating boot disks.
The integration also allows for the MDT environment to be accessed from within the ConfigMgr task sequence through MDT packages created by an MDT task sequence wizard installed in the ConfigMgr console. This also allows accessing the MDT Deployment Database from within the ConfigMgr environment to set deployment variables (instead of putting them as collection variables).
The dynamic computer naming process I will describe below uses these integration points and runs UserExit scripts. The USerExit script that is part of this post dynamically builds the computer name by allowing you to run an external script and return the output of the script to the task sequence process as a variable.
The computer name generated by the UserExit script will be based on a location ID (two characters added as a custom property in MDT Deployment Database), the computer chassis typed (L for laptop, W for Workstation, V for Virtual, and X if the chassis can not be identified), and the first seven characters of the computer serial number (removing spaces and replacing them with a minus (-) for situations where the serial number contains spaces such as virtual machines serial numbers).
These three properties are then glued together and provided as the OSDComputername variable for deployment. Hence, you end up with a computer name such as UK (location ID) L (Chassis ID) 1234567 (Serial Number ID). ConfigMgr SCCM Dynamic Computer Naming in Zero Touch Deployments.
For the dynamic computer naming to work, we need carry out the following task
- Create a new property in the MDT Deployment Database (for the two character location ID)
- Configure the CustomSettings.ini file (in the MDT settings package) to query the MDT Deployment Database and run the UserExit script
- Create the UserExit script that does the generation of the computer name and add it to the MDT Toolkit package
The instructions below assume that you have:
- Installed MDT 2010/2012 (probably on your central site server) and setup an MDT database.
- Run the MDT Integration (accessed through the MDT start menu folder and running Install ConfigMgr Integration)
- Created a task sequence in ConfigMgr using the MDT integration and utilising the MDT supplied client task sequence template – if you walked through the MDT task sequence wizard you should have also created the MDT support packages (MDT Boot Image, MDT Settings, MDT Toolkit and MDT USMT packages).
Step 1 – Create a new custom property in the MDT Deployment Database (for the two-character location ID)
The MDT Deployment Database provided with MDT 2010/2012 on the surface looks very simple – but is very powerful. ConfigMgr SCCM Dynamic Computer Naming in Zero Touch Deployments.
In this database, we can store all of the variables that we used in the MDT Lite Touch world and extra OSD-based variables for use in Zero Touch and server build task sequences. The MDT Deployment Database contains four main areas for storing variables – Computers, Location, Roles, and Make/Model. In the underlying structure of the database, a separate table stores the settings that are then made visible through the DETAILS tab in each of these areas………
Anoop is Microsoft MVP! He is a Solution Architect in enterprise client management with more than 20 years of experience (calculation done in 2021) in IT. He is a blogger, Speaker, and Local User Group HTMD Community leader. His main focus is on Device Management technologies like SCCM 2012, Current Branch, and Intune. E writes about ConfigMgr, Windows 11, Windows 10, Azure AD, Microsoft Intune, Windows 365, AVD, etc…
1 thought on “ConfigMgr SCCM Dynamic Computer Naming in Zero Touch Deployments”
Im reading your blog on regular basis and I have to say its a great knowledge base. Regarding the article for computer naming I have created webservice for dynamic computer naming (RIS style)
Tutorial is at http://www.itx-solutions.nl/sccm/sccm-osd-dynamic-computer-naming-dynamically-generate-computer-name/
Your feedback would be much appreciated