How to fix Device Name template in Azure AD Joined machine enrolled via Intune Autopilot

Shekhar, Sumeet (Cognizant) 66 Reputation points
2024-01-30T13:47:19.4633333+00:00

We are deploying Windows 10 devices using Windows Autopilot in an Azure AD only joined environment. In the Windows Deployment Autopilot profile we have set "Apply device name template" as ABCDEFGH%RAND:7%.

During the enrollment 8 or 9 out of 10 devices will get the correct name but 1 or 2 devices will have the incorrect name starting from either "DESKTOP-" or "LAPTOP-". WE normally after the enrolment is complete rename the device by going to the Intune Device properties.

  1. What could be the reason for the names to be not correct
  2. Is there a way to fix it during the enrolment by having some kind of a check using a script.

Kindly suggest.

Thanks and Regards

Sumeet Shekhar

Windows Autopilot
Windows Autopilot
A collection of Microsoft technologies used to set up and pre-configure new devices and to reset, repurpose, and recover devices.
468 questions
Microsoft Intune Enrollment
Microsoft Intune Enrollment
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Enrollment: The process of requesting, receiving, and installing a certificate.
1,367 questions
0 comments No comments
{count} votes

Accepted answer
  1. ZhoumingDuan-MSFT 13,245 Reputation points Microsoft Vendor
    2024-01-31T01:58:22.72+00:00

    @Shekhar, Sumeet (Cognizant), Thanks for posting in Q&A.

    From your description, I know that you encountered an issue that Intune Autopilot Device Name template settings does not work as excepted.

    Based on my research, there could be some reasons for the issue.

    1.This happens if you enroll the device before the Autopilot profile has been assigned to the device.

    2.To apply device name template, it requires Windows 10, version 1809 or later, and Azure AD join type. Also, names must be 15 characters or less, and can have letters, numbers, and hyphens. Names can't be all numbers. Use the %SERIAL% macro to add a hardware-specific serial number. Or use the %RAND:x% macro to add a random string of numbers, where x equals the number of digits to add.

    3.This typically happens when Autopilot enrollment is run on a Wi-Fi network or using an external USB ethernet dongle. So, in general it is caused by network latency that results in the client not downloading the correct policies from Intune before enrollment continues.

    As for fix it during the enrolment via script, there is no script for this currently. However, you can fix it through Azure Automation after enrollment follow the link below.

    https://doitpsway.com/fix-for-incorrectly-named-devices-enrolled-using-autopilot-through-azure-automation

    Non-official, just for reference.

    Or, you can check the right device name before enrollment or bulk rename the incorrect device name via Intune portal.

    User's image

    Hope this can help you, and if there is any update, feel free to contact me.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.