Rename Device in Azure AD and Intune

Scenario

You joined a device to Azure AD then later on renamed it.  The display name is never updated in Azure AD or Intune.  The resolution?  Change the display name using PowerShell of course!

Steps

  • If you don’t already have it get the Azure AD PowerShell module here
  • Once the module is installed open PowerShell and connect to Azure AD:

$credential = Get-credential

Connect-AzureAD -Credential $credential

  • Once connected get the objectID of the device you need to update:

Get-AzureADDevice (this will display a list of all Azure joined devices and their objectID’s)

  • Using the objectID of the device you wish to update type the following:

Set-AzureADDevice -objectID “objectID of device” -displayname “new display name”

  • Confirm changes made in Azure AD and Intune
  • Confirm via powershell

Get-AzureADDevice -objectID “objectID of device”

Done!

 

8 responses to “Rename Device in Azure AD and Intune

  1. This is great thanks but what if you don’t know the DeviceId of the device? I’ve run this in a laptop where the name was the default DESKTOP-XXXXXX but it was renamed for LAPTOP045 so we have no record of the original name. Is there a way to find the DeviceId of the current device?

    1. Just answering my own question, I found a bit of a hack to dig out the current device ID by querying the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CloudDomainJoin\JoinInfo area of the registery. There is a subkey in there that is the device ID.

  2. I used this command to change the display names of Windows smartphones in the devices list in Intune. But 24 hrs later the list still shows the old names (the ones with the timestamp).

    Get-AzureDDevice shows the new names.

    Why doesn’t Intune show the new names?

    1. I would check what the Device displays as in Azure AD and confirm it is what you intended it to be. It seems that recently Intune (old portal) and Azure Intune (new portal) are independent of each other. For a time they were hybrid during migration. This is my thought on why the new device name will not show up in the old portal.

      1. Today I used Get-AzureDDevice and all my name changes have reverted to the old names.
        What am I missing..?

Comments are closed.