I'm trying to set the computername for a Surface Pro 4 based on the serialnumber. I added the variable to my CustomSetting file as follow : ComputerName=MTLSP%SerialNumber%, but my task sequence fails when it comes to assign the name.

Am I missing something ?

PS : we use the assettag variable for desktops|laptops and it works like a charm.


Computer names can be a maximum of 16 digits. Surface Pro 4 serial numbers are 12 digits. Prepending 5 characters to that exceeds the limit.


I think the variable you need to use is OSDComputerName.


To automatically set the computer name you will want to skip the deployment wizard step that asks for the computer name and then specify the computer name on the back end.

Skip deployment wizard name gathering step

Add this to your cusotmsettings.ini file:


Name the computer on the back end

Next you will need to specify what the computer name will be since it will now not ask the user for the name.

You can do this by indicating what the computer name should be by using this variable in your customsettings.ini file.


You can use variables in your OSDComputerName setting, E.G.:

OSDComputerName=PC_%SerialNumber% or OSDComputerName=MTLSP%SerialNumber%




Make sure that you skip the deployment wizard step and then use the correct variable to automatically name your computer. You can do that with the below customsetting.ini settings:

SkipComputerName=yes OSDComputerName=PC_%SerialNumber%

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.