Back in 2012 I wrote an article about dynamically setting a computer name during a Task Sequence. Here is my updated and improved script..

I’m currently setting up a deployment solution running SCCM with MDT 2013. The idea was to set up a User Driven Installation (UDI) so the IT department would have to do as little as possible during the installation process.

Part of this solution was to manage the clients names. We decided to use the ethernet MAC-address as an identifier. The script collects the last 7 characters (without dashes) from the MAC-address (UUID), and sets it as the OSDComputerName.

Save the script in your MDT package under the Scripts-folder:

Update the DP’s and head over to your Task Sequence.
Scroll down to PostInstall and under Gather add a Run Command Line-step.
In the Command line box type:

Deploy and ENJOY! :)