This procedure works like this: If they computername is in the database already (known), it will assign that name to the PC. If the computer is not in the database (unknown), it will generate a computername based on the prefix and the next sequencenumber.
Note: This post is for MDT 2010, for MDT 2012 or later versions, use this guide and sample code: Generate computer names in MDT 2012/2013 based on prefix and a sequence number. (the database tables have changed between MDT 2010 and future versions)
Step 1- Setting up the Database
Below you find a detailed step-by-step guide, and there also a video tutorial available on our YouTube channel: Part 18 of the MDT 2010 Lite Touch – Unleashed series.
- On the MDT Server (MDT01 in my example), install SQL Server 2008 Express SP1. After installation, enable Named Pipes and restart the service
- Using the Deployment Workbench, in the advanced node, create a new Database (named MDT in my example)
- Using SQL Management Studio (Server name is MDT01\SQLEXPRESS), create a Security Login for the domain user account that you use for your Lite Touch installations
- For the previously created Security Login, add the following permissions to the MDT Database.
Step 2 – Add needed Stored Procedure and Tables
Below you find a detailed step-by-step guide, and there also a video tutorial available on our YouTube channel: Part 19 of the MDT 2010 Lite Touch – Unleashed series.
- Download the files from here…
Generate Computer Names using the MDT Database
- Using SQL Management Studio, open the InsertComputerNames.sql script and execute it (F5)
- For the Security Login created in Step 1, grant execute permissions to the IdentifyComputer Stored Procedure (found under Programmability / Stored Procedures)
- Open the MachineName.sql script and execute it (F5)
- Edit the MachineNameSequence table, in the prefix field, type in PC, in the sequence field type in 0 (Zero)
Step 3 – Configure the Deployment Share rules
- Use the info in the sample customsettings.ini file to configure the rules on your deployment share to use the stored procedure.
[Settings] Priority=IdentifyComputer, CSettings, Default [Default] OSInstall=Y [CSettings] SQLServer=MDT01 Instance=SQLEXPRESS Database=MDT Netlib=DBNMPNTW SQLShare=Logs$ Table=ComputerSettings Parameters=UUID, AssetTag, SerialNumber, MacAddress ParameterCondition=OR [IdentifyComputer] SQLServer=MDT01 Instance=SQLEXPRESS Database=MDT Netlib=DBNMPNTW SQLShare=Logs$ StoredProcedure=IdentifyComputer Parameters=MacAddress