question

EdK-2465 avatar image
0 Votes"
EdK-2465 asked EdK-2465 edited

Powershell to update Intune DevicemanagementName

Hi everyone,

I'm looking to use powershell to modify some Android device Management Names in Intune. I've managed to figure out how to find the device I want to change using the Get-IntuneManagedDevice.

$Device=Get-IntuneManagedDevice |Where-Object {$_.SerialNumber -match $Serial}

but I cannot figure out how to write to Intune and modify the DeviceManagementName

I'm sure it's a super simple code, but I seem to be an idiot. Can someone show me how to write that change?

windows-server-powershellmem-intune-device-configurationsmicrosoft-graph-device-updates
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@EdK-2465 Thanks for posting in our Q&A.

Honestly, I'm not familiar with Powershell. So, I just share a little idea with you. For this issue, I have done a lot of research. I find that "Update managedDevice" will meet the requirement.
https://docs.microsoft.com/en-us/graph/api/intune-devices-manageddevice-update?view=graph-rest-1.0#request

In the request example, it has the property "managedDeviceName", and we can update the value of it.
160138-image.png


0 Votes 0 ·
image.png (22.2 KiB)
TimmyAndersson avatar image
0 Votes"
TimmyAndersson answered LuDaiMSFT-0289 commented

Thanks for posting your question,

You are on the right track, with the current line of powershell you have there you are getting data from Graph to match with the serial number you have in your variable.
The next step would be to update the information to set a new management name on the device and it can be done with the following example:

 Update-IntuneManagedDevice -managedDeviceId $device.id -managedDeviceName "New management device name"

hope this helps.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank TimmyAndersson for the valuable input.

@EdK-2465 Haven't heard from you for some time. Have all the concern been addressed? Is there any other assistance that we can provide?

If TimmyAndersson's reply is helpful, please accept his answer.

Thanks for your kindness in advance.

0 Votes 0 ·
EdK-2465 avatar image
0 Votes"
EdK-2465 answered EdK-2465 edited

Thanks TimmyAnderson! Sorry for the delay.. i stepped away for the holidays. Your update command worked for me. Root beers on me when I get a chance. :)

Now to figure out how to add it to a group. :)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.