Script Runbook on azure automation to rename android device intune

raorla 5 Reputation points
2023-06-15T09:41:50.19+00:00

Hello all , has anyone ever run a schedule task with Script Runbook on azure automation to rename android device intune

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,366 questions
Microsoft Security Intune Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Simon Ren-MSFT 40,341 Reputation points Microsoft External Staff
    2023-06-16T02:43:25.3233333+00:00

    Hi,

    Thank you for posting in Microsoft Q&A forum.

    Per my experience, it is possible to use Script Runbook on Azure Automation to rename Android devices in Intune. You can use the "Rename device" action in the Intune admin center to change the device name, and then use Azure Automation to automate this process on a schedule.

    First, you will need to create a PowerShell script to rename the device. Here is an example script that you can modify to your needs:

    # Connect to Intune

    Connect-AzureAD

    # Get device by ID

    $device = Get-AzureADDevice -ObjectID "<Device Object ID>"

    # Rename device

    Set-AzureADDevice -ObjectID $device.ObjectID -DisplayName "<New Device Name>"

    Replace <Device Object ID> with the ID of the device you want to rename, and <New Device Name> with the new name you want to give to the device.

    Save this script to a file in your Azure Automation account.

    Next, create a new Runbook in your Automation account and paste the script into the editor. You can then set a schedule for the Runbook to run on a regular basis, such as daily or weekly.

    When the Runbook runs, it will connect to Intune, retrieve the device you specified, and rename it to the new name you specified. You can monitor the status of the Runbook and view any output or errors in the Azure portal.

    References:

    Microsoft: Rename a device in Intune

    Thanks for your time. Have a nice day!

    Best regards,

    Simon


    If the response is helpful, please click "Accept Answer" and upvote it.

    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.

    2 people found this answer helpful.

  2. Simon Ren-MSFT 40,341 Reputation points Microsoft External Staff
    2023-06-23T08:42:46.83+00:00

    Hi,

    Hope everything goes well. Do you need any further assistance about this issue? If yes, please feel free to let us know, we will do our best to help you.

    If the response is helpful, it's appreciated that you could click "Accept Answer" and upvote it, this will help other users to search for useful information more quickly.

    Thanks for your time.

    Best regards,

    Simon


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.