gpt4 book ai didi

azure - 不存在与模板匹配的 OData 路由 - 在 Azure intune 中添加 CorporateIdentifier

转载 作者:行者123 更新时间:2023-12-03 04:06:33 38 4
gpt4 key购买 nike

GET 列出添加的公司设备标识符的请求有效:

https://graph.microsoft.com/beta/deviceManagement/importedDeviceIdentities

POST 请求添加公司标识符,如下所示,我收到错误:

https://graph.microsoft.com/beta/deviceManagement/importedDeviceIdentities
{
"@odata.type": "#microsoft.graph.importedDeviceIdentity",
"importedDeviceIdentifier": "01HW0000",
"importedDeviceIdentityType": "serialNumber",
"lastContactedDateTime": "2019-12-31T23:58:44.2908994-08:00",
"description": "C02CCCCC",
"enrollmentState": "unknown",
"platform": "macOS"
}

回应:

{
"error": {
"code": "No method match route template",
"message": "No OData route exists that match template ~/singleton/navigation with http verb POST for request /DeviceEnrollmentFE/StatelessDeviceEnrollmentFEService/deviceManagement/importedDeviceIdentities.",
"innerError": {
"request-id": "be06d7c6-9016-4684-9a82-d65b50d333eb",
"date": "2020-01-04T17:33:07"
}
}
}

最佳答案

我已经对来自 Intune 门户的正确调用进行了逆向工程,下面是一个有效的 Powershell 示例。请注意,您需要图形权限“DeviceManagementServiceConfig.ReadWrite.All”。

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("OData-MaxVersion", "4.0")
$headers.Add("OData-Version", "4.0")
$headers.Add("Content-Type", "application/json")
$headers.Add("Authorization", "Bearer eyTOKEN")

$body = @"
{
`"overwriteImportedDeviceIdentities`": false,
`"importedDeviceIdentities`": [
{
`"importedDeviceIdentityType`": `"serialNumber`",
`"importedDeviceIdentifier`": `"111111xxxxx`",
`"description`": `"description`"
}
]
}
"@

$response = Invoke-RestMethod 'https://graph.microsoft.com/beta/deviceManagement/importedDeviceIdentities/importDeviceIdentityList' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json

关于azure - 不存在与模板匹配的 OData 路由 - 在 Azure intune 中添加 CorporateIdentifier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59593225/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com