I'm trying to pull a report from Graph API regarding the Intune device field activationLockBypassCode. When done through Graph Explorer, I get a result.
Sample query through Graph Explorer:
https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/6dc10fc7-xxxx-xxxx-xxxx-cad206f334f4?$select=activationLockBypassCode
Result from Graph Explorer:
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#deviceManagement/managedDevices(activationLockBypassCode)/$entity",
"activationLockBypassCode": "XXXXX-MC9J1-XXXX-H5JN-NY2L-XXXX"
However, when I try to call on the API myself through Powershell, I receive the following:
Query:
$URI4 = "https://graph.microsoft.com/beta/deviceManagement/managedDevices/6dc10fc7-xxxx-xxxx-xxxx-cad206f334f4?`$select=activationLockBypassCode"
Invoke-RestMethod -Headers $Headers -Uri $URI4 -Method GET
Results:
@odata.context activationLockBypassCode
-------------- ------------------------
https://graph.microsoft.com/beta/$metadata#deviceManagement/managedDevices(activationLockBypassCode)/$entity
Anyone have any clue as to why this is?