The Set Hostname task sequence step allows you to assign a hostname to a Mac computer. Suppose we want a hostname to contain a Mac’s serial number (e.g. AcmeCorp_C05D78UJKO). This would make it easy to assign a unique hostname to a Mac without requiring user input.
Adding serial number to a hostname in the Set Hostname step
Create SCCM software package, but do NOT specify any source files for it:
- Specify the following command line for the package:
This command retrieves the Mac’s serial number from the system_profiler and assigns it to the OSDSerialNumber task sequence variable. It does this by using the command line utility, which can be accessed via the path contained in the PMM_TS_VARIABLE_UTIL environment variable.
Set the Program can run property to Whether or not a user is logged on.
Do NOT deploy this package to any collection.
Do NOT distribute contents of this package to Distribution Points (it doesn’t contain any source files, so it’s not needed).
When creating or modifying a task sequence, add the Install Software step after the Apply OS X Image step. Specify the software package that you created in the previous steps of this article.
- Add the Set Hostname step after the Install Software step. In the Hostname field, type “Mac-%OSDSerialNumber%” (without quotes).
If anything goes wrong during the task sequence execution, you can troubleshoot the problem using the following log:
This log contains information about installing software packages, setting hostname, joining domain, and installing the Parallels Mac Client package.
The following screenshot is a sample of the pmm_launchd_helper.log file. The highlighted section contains the information about obtaining the Mac’s serial number.