Add application permission support to Delete AAD devices

Add application permission support to Delete AAD devices
13

Upvotes

Upvote

 Oct 29 2021
3 Comments (3 New)
New

Add application permission support to Delete AAD devices.

 

This is currently not supported when used with application authentication: https://docs.microsoft.com/en-us/graph/api/device-delete?view=graph-rest-beta&tabs=http

 

$AuthToken = Get-MsalToken -ClientId $ClientId -TenantId $TenantId -ClientCertificate $ClientCertificate

$ResourceUrl = "https://graph.microsoft.com/beta/devices/{id}"
Invoke-RestMethod -Headers @{Authorization = "Bearer $($AuthToken.AccessToken)"} -Uri $ResourceUrl -Method Delete

 

or

 

Remove-MgDevice -DeviceId {id}

Comments
Occasional Visitor

Would be nice to be able to have this functionality in Azure Automation implemented with Application Identities.

Occasional Contributor

HI,

Maj 2022 and it still not implemented. 

 

Senior Member

Same goes for Update-MgDevice. Only delegated permissions work.