Learn how to use a Library Item or MDM command to set device names
What is the Device Name Library Item?
The Device Name Library Item is designed to help IT administrators apply consistent naming conventions across Apple devices. It provides flexibility and comprehensive control over device naming, making managing devices easier.
Administrators can create standardized naming patterns using customizable formulas. These formulas can include variables such as asset tags, user names, blueprint names, company names, serial numbers, and custom text, allowing for a tailored approach to device naming. The Device Name Library Item also manages device hostnames by replacing spaces with hyphens, ensuring compatibility with systems that rely on hostnames, like network security appliances.
This Library Item requires supervision.
- Add a Device Name Library Item
- Navigate to Library in the left-hand navigation bar.
- Configure the Device Name Library Item
- Device name modification
- Manually rename a device
Add a Device Name Library Item
- Navigate to Library in the left-hand navigation bar.
- Click Add New on the top-right, and choose Device Name.
- Click Add & Configure.
- Give the new Device Name Library Item a name.
- Assign to your desired Assignment Maps or Classic Blueprints.
Configure the Device Name Library Item
Device Name
- Drag variables in the Device name pattern field to define your desired pattern. Be mindful of platform-specific differences; for example, "Primary local user name" is not available on iOS and iPadOS.
- Review the resulting pattern preview.
Hostname
By default, the Device Name Library Item will use the same pattern for the device name and hostname. Optionally, you can configure the Device Name Library Item to have separate device name and hostname patterns on Mac computers (allowing the device name to be more user-friendly).
- Select Customize hostname.
- Drag variables into the hostname pattern field to define your desired pattern. Be mindful of platform-specific differences; for example, "Primary local user name" is unavailable on iOS and iPadOS.
- Review the resulting pattern preview.
Hostname Considerations
- If you deselected Mac in the device families, the Hostname section will be disabled as MDM can only manage hostname on Mac. iOS, iPadOS and tvOS set their hostname automatically based on the Device Name.
- iOS and iPadOS devices connect to Wi-Fi networks with Private Wi-Fi Address turned on by default. With this setting turned on, the device does not share the hostname with the network. Instead, it shares the device's Model Name, e.g., iPad Pro 11 (4th Gen). You can turn this setting off using the Disable MAC address randomization configuration option in the Wi-Fi Library Item.
Device name modification
- Optionally, to prevent users from modifying the device name or hostname, select the Prevent users from modifying device name and hostname checkbox.
- Click the Save button to save the Device Name Library Item to your Library.
On iOS, iPadOS, tvOS and macOS 14 Sonoma and later, this will set the Supervised restriction preventing users from modifying their device's name. On macOS versions prior to macOS 14 Sonoma, the Kandji Agent will remediate device name and hostname changes after the next Agent check-in.
Manually rename a device
macOS, iOS, iPadOS, and tvOS device names can be set directly on the associated device record page. This action will be unavailable if you have a Device Name Library Item set to configure the device's name.
This Device Action requires supervision.
- Navigate to a device record.
- Click the Device Action menu in the upper right corner.
- Click Set device name from the action menu.
- Enter a device name into the Set Device Name window.
- Click Set Device Name.