命名空间:microsoft.graph
注意:适用于 Intune 的 Microsoft Graph API 需要适用于租户的活动 Intune 许可证。
更新 managedDevice 对象的属性。
此 API 可用于以下国家级云部署。
| 全局服务 | 美国政府 L4 | 美国政府 L5 (DOD) | 由世纪互联运营的中国 |
|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ |
权限
要调用此 API,需要以下权限之一。 若要了解详细信息,包括如何选择权限的信息,请参阅权限。
| 权限类型 | 权限(从最低特权到最高特权) |
|---|---|
| 委派(工作或学校帐户) | DeviceManagementManagedDevices.ReadWrite.All |
| 委派(个人 Microsoft 帐户) | 不支持。 |
| 应用程序 | DeviceManagementManagedDevices.ReadWrite.All |
HTTP 请求
PATCH /deviceManagement/managedDevices/{managedDeviceId}
PATCH /deviceManagement/detectedApps/{detectedAppId}/managedDevices/{managedDeviceId}
PATCH /deviceManagement/detectedApps/{detectedAppId}/managedDevices/{managedDeviceId}/users/{userId}/managedDevices/{managedDeviceId}
请求标头
| 标头 | 值 |
|---|---|
| Authorization | 持有者 {token}。 必填。 详细了解 身份验证和授权。 |
| 接受 | application/json |
请求正文
在请求正文中,提供 managedDevice 对象的 JSON 表示形式。
下表显示创建 managedDevice 时所需的属性。
| 属性 | 类型 | 说明 |
|---|---|---|
| id | String | 设备的唯一标识符。 此属性是只读的。 |
| userId | String | 与设备关联的用户的唯一标识符。 此属性是只读的。 |
| deviceName | String | 设备的名称。 此属性是只读的。 |
| managedDeviceOwnerType | managedDeviceOwnerType | 设备的所有权。 可以是“公司”或“个人”。 可能的值包括 unknown、company、personal。 |
| deviceActionResults | deviceActionResult 集合 | ComplexType deviceActionResult 对象的列表。 此属性是只读的。 |
| enrolledDateTime | DateTimeOffset | 设备的注册时间。 支持$filter运算符“lt”和“gt”。 此属性是只读的。 |
| lastSyncDateTime | DateTimeOffset | 设备上次成功完成与 Intune 同步的日期和时间。 支持$filter运算符“lt”和“gt”。 此属性是只读的。 |
| operatingSystem | String | 设备的操作系统。 Windows、iOS 等。此属性是只读的。 |
| complianceState | complianceState | 设备的符合性状态。 示例:符合性、冲突、错误等。默认值为未知。 支持$filter运算符“eq”和“or”。 此属性是只读的。 可取值包括:unknown、compliant、noncompliant、conflict、error、inGracePeriod、configManager。 |
| jailBroken | String | 设备是否越狱或已获取 root 权限。 默认值为空字符串。 支持$filter运算符“eq”和“or”。 此属性是只读的。 |
| managementAgent | managementAgentType | 设备的管理通道。 示例:Intune、EAS 等。默认值未知。 支持$filter运算符“eq”和“or”。 此属性是只读的。 可能的值为:eas、、mdm、、easMdm、configurationManagerClientMdmconfigurationManagerClientconfigurationManagerClientMdmEaseasIntuneClientintuneClient、、unknownjamf、、 。 googleCloudDevicePolicyController |
| osVersion | String | 设备的操作系统版本。 此属性是只读的。 |
| easActivated | Boolean | 设备是否已激活 Exchange ActiveSync。 此属性是只读的。 |
| easDeviceId | String | 设备的 Exchange ActiveSync ID。 此属性是只读的。 |
| easActivationDateTime | DateTimeOffset | 设备的 Exchange ActivationSync 激活时间。 此属性是只读的。 |
| azureADRegistered | Boolean | 设备是否已注册 Azure Active Directory。 此属性是只读的。 |
| deviceEnrollmentType | deviceEnrollmentType | 设备的注册类型。 此属性是只读的。 可能的值为:unknown、、userEnrollmentdeviceEnrollmentManager、windowsAzureADJoinwindowsBulkUserlesswindowsAutoEnrollmentappleBulkWithUserappleBulkWithoutUserwindowsBulkAzureDomainJoin、windowsCoManagement、windowsAzureADJoinUsingDeviceAuth、appleUserEnrollment、 。 appleUserEnrollmentWithServiceAccount |
| activationLockBypassCode | String | 允许绕过托管设备上的激活锁的代码。 在 LIST 调用中作为 managedDevice 实体的一部分返回时,默认值为 Null (非默认属性) 。 若要检索实际值,需要使用设备 ID 进行 GET 调用,并将其包含在 select 参数中。 支持:$select。 不支持$Search。 只读。 此属性是只读的。 |
| emailAddress | String | Email (与设备关联的用户的) 。 此属性是只读的。 |
| azureADDeviceId | String | Azure Active Directory 设备的唯一标识符。 只读。 此属性是只读的。 |
| deviceRegistrationState | deviceRegistrationState | 设备注册状态。 此属性是只读的。 可能的值为:notRegistered、、registered、revoked、keyConflictapprovalPending、certificateReset、notRegisteredPendingEnrollment、 。 unknown |
| deviceCategoryDisplayName | String | 设备类别显示名称。 默认值为空字符串。 支持$filter运算符“eq”和“or”。 此属性是只读的。 |
| isSupervised | 布尔值 | 设备受监督状态。 此属性是只读的。 |
| exchangeLastSuccessfulSyncDateTime | DateTimeOffset | 设备上次与 Exchange 联系的时间。 此属性是只读的。 |
| exchangeAccessState | deviceManagementExchangeAccessState | Exchange 中设备的访问状态。 此属性是只读的。 可能的值包括 none、unknown、allowed、blocked、quarantined。 |
| exchangeAccessStateReason | deviceManagementExchangeAccessStateReason | Exchange 中设备访问状态的出现原因。 此属性是只读的。 可能的值为:none、、exchangeGlobalRuleunknown、otherexchangeDeviceRulecompliantexchangeMailboxPolicyexchangeIndividualRuleexchangeUpgrade、notCompliant、notEnrolledunknownLocation、mfaRequired、、azureADBlockDueToAccessPolicy、、compromisedPassword、 。 deviceNotKnownWithManagedApp |
| remoteAssistanceSessionUrl | String | 允许与设备建立远程协助会话的 URL。 默认值为空字符串。 若要检索实际值,需要使用设备 ID 进行 GET 调用,并将其包含在 select 参数中。 此属性是只读的。 |
| remoteAssistanceSessionErrorDetails | String | 用于在创建远程协助会话对象时识别问题的错误字符串。 此属性是只读的。 |
| isEncrypted | 布尔值 | 设备加密状态。 此属性是只读的。 |
| userPrincipalName | String | 设备用户主体名称。 此属性是只读的。 |
| model | String | 设备的型号。 此属性是只读的。 |
| manufacturer | String | 设备的制造商。 此属性是只读的。 |
| imei | String | IMEI。 此属性是只读的。 |
| complianceGracePeriodExpirationDateTime | DateTimeOffset | 设备符合性宽限期到期时的 DateTime。 此属性是只读的。 |
| serialNumber | String | SerialNumber。 此属性是只读的。 |
| phoneNumber | String | 设备的电话号码。 此属性是只读的。 |
| androidSecurityPatchLevel | String | Android 安全修补程序级别。 此属性是只读的。 |
| userDisplayName | String | 用户显示名称。 此属性是只读的。 |
| configurationManagerClientEnabledFeatures | configurationManagerClientEnabledFeatures | 已启用 ConfigrMgr 客户端的功能。 此属性是只读的。 |
| wiFiMacAddress | String | Wi-Fi MAC。 此属性是只读的。 |
| deviceHealthAttestationState | deviceHealthAttestationState | 设备运行状况证明状态。 此属性是只读的。 |
| subscriberCarrier | String | 订阅者运营商。 此属性是只读的。 |
| meid | String | MEID。 此属性是只读的。 |
| totalStorageSpaceInBytes | Int64 | 总存储(以字节为单位)。 此属性是只读的。 |
| freeStorageSpaceInBytes | Int64 | 可用存储(以字节为单位)。 默认值为 0 。 只读。 此属性是只读的。 |
| managedDeviceName | String | 用于识别设备的自动生成的名称。 可以覆盖为用户友好名称。 |
| partnerReportedThreatState | managedDevicePartnerReportedHealthState | 指示帐户和设备正在使用移动威胁防护合作伙伴时设备的威胁状态。 只读。 此属性是只读的。 可取值包括:unknown、activated、deactivated、secured、lowSeverity、mediumSeverity、highSeverity、unresponsive、compromised、misconfigured。 |
| requireUserEnrollmentApproval | 布尔值 | 报告托管 iOS 设备是否为用户审批注册。 此属性是只读的。 |
| managementCertificateExpirationDate | DateTimeOffset | 报告设备管理证书到期日期。 此属性是只读的。 |
| iccid | String | 集成电路卡标识符,它是 SIM 卡的唯一标识号。 默认值为空字符串。 若要检索实际值,需要使用设备 ID 进行 GET 调用,并将其包含在 select 参数中。 支持:$select。 不支持$Search。 只读。 此属性是只读的。 |
| udid | String | iOS 和 macOS 设备的唯一设备标识符。 默认值为空字符串。 若要检索实际值,需要使用设备 ID 进行 GET 调用,并将其包含在 select 参数中。 支持:$select。 不支持$Search。 只读。 此属性是只读的。 |
| notes | String | IT 管理员创建的设备上的说明。默认值为 null。 若要检索实际值,需要使用设备 ID 进行 GET 调用,并将其包含在 select 参数中。 支持:$select。 不支持$Search。 |
| ethernetMacAddress | String | 指示设备的以太网 MAC 地址。 作为 managedDevice 实体的一部分返回时,默认值为 Null (非默认属性) 。 需要具有选择查询选项的单个 get 调用才能检索实际值。 示例:deviceManagement/managedDevices ({managedDeviceId}) ?$select=ethernetMacAddress 支持:$select。 不支持$Search。 只读。 此属性是只读的。 |
| physicalMemoryInBytes | Int64 | 总内存(以字节为单位)。 默认值为 0。 若要检索实际值,需要使用设备 ID 进行 GET 调用,并将其包含在 select 参数中。 支持:$select。 只读。 此属性是只读的。 |
| enrollmentProfileName | String | 分配给设备的注册配置文件的名称。 默认值为空字符串,指示未执行任何注册配置文件。 此属性是只读的。 |
响应
如果成功,此方法在响应正文中返回 200 OK 响应代码和更新的 managedDevice 对象。
示例
请求
下面是一个请求示例。
PATCH https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/{managedDeviceId}
Content-type: application/json
Content-length: 5058
{
"@odata.type": "#microsoft.graph.managedDevice",
"userId": "User Id value",
"deviceName": "Device Name value",
"managedDeviceOwnerType": "company",
"deviceActionResults": [
{
"@odata.type": "microsoft.graph.deviceActionResult",
"actionName": "Action Name value",
"actionState": "pending",
"startDateTime": "2016-12-31T23:58:46.7156189-08:00",
"lastUpdatedDateTime": "2017-01-01T00:00:56.8321556-08:00"
}
],
"enrolledDateTime": "2016-12-31T23:59:43.797191-08:00",
"lastSyncDateTime": "2017-01-01T00:02:49.3205976-08:00",
"operatingSystem": "Operating System value",
"complianceState": "compliant",
"jailBroken": "Jail Broken value",
"managementAgent": "mdm",
"osVersion": "Os Version value",
"easActivated": true,
"easDeviceId": "Eas Device Id value",
"easActivationDateTime": "2016-12-31T23:59:43.4878784-08:00",
"azureADRegistered": true,
"deviceEnrollmentType": "userEnrollment",
"activationLockBypassCode": "Activation Lock Bypass Code value",
"emailAddress": "Email Address value",
"azureADDeviceId": "Azure ADDevice Id value",
"deviceRegistrationState": "registered",
"deviceCategoryDisplayName": "Device Category Display Name value",
"isSupervised": true,
"exchangeLastSuccessfulSyncDateTime": "2017-01-01T00:00:45.8803083-08:00",
"exchangeAccessState": "unknown",
"exchangeAccessStateReason": "unknown",
"remoteAssistanceSessionUrl": "https://example.com/remoteAssistanceSessionUrl/",
"remoteAssistanceSessionErrorDetails": "Remote Assistance Session Error Details value",
"isEncrypted": true,
"userPrincipalName": "User Principal Name value",
"model": "Model value",
"manufacturer": "Manufacturer value",
"imei": "Imei value",
"complianceGracePeriodExpirationDateTime": "2016-12-31T23:56:44.951111-08:00",
"serialNumber": "Serial Number value",
"phoneNumber": "Phone Number value",
"androidSecurityPatchLevel": "Android Security Patch Level value",
"userDisplayName": "User Display Name value",
"configurationManagerClientEnabledFeatures": {
"@odata.type": "microsoft.graph.configurationManagerClientEnabledFeatures",
"inventory": true,
"modernApps": true,
"resourceAccess": true,
"deviceConfiguration": true,
"compliancePolicy": true,
"windowsUpdateForBusiness": true
},
"wiFiMacAddress": "Wi Fi Mac Address value",
"deviceHealthAttestationState": {
"@odata.type": "microsoft.graph.deviceHealthAttestationState",
"lastUpdateDateTime": "Last Update Date Time value",
"contentNamespaceUrl": "https://example.com/contentNamespaceUrl/",
"deviceHealthAttestationStatus": "Device Health Attestation Status value",
"contentVersion": "Content Version value",
"issuedDateTime": "2016-12-31T23:58:22.1231038-08:00",
"attestationIdentityKey": "Attestation Identity Key value",
"resetCount": 10,
"restartCount": 12,
"dataExcutionPolicy": "Data Excution Policy value",
"bitLockerStatus": "Bit Locker Status value",
"bootManagerVersion": "Boot Manager Version value",
"codeIntegrityCheckVersion": "Code Integrity Check Version value",
"secureBoot": "Secure Boot value",
"bootDebugging": "Boot Debugging value",
"operatingSystemKernelDebugging": "Operating System Kernel Debugging value",
"codeIntegrity": "Code Integrity value",
"testSigning": "Test Signing value",
"safeMode": "Safe Mode value",
"windowsPE": "Windows PE value",
"earlyLaunchAntiMalwareDriverProtection": "Early Launch Anti Malware Driver Protection value",
"virtualSecureMode": "Virtual Secure Mode value",
"pcrHashAlgorithm": "Pcr Hash Algorithm value",
"bootAppSecurityVersion": "Boot App Security Version value",
"bootManagerSecurityVersion": "Boot Manager Security Version value",
"tpmVersion": "Tpm Version value",
"pcr0": "Pcr0 value",
"secureBootConfigurationPolicyFingerPrint": "Secure Boot Configuration Policy Finger Print value",
"codeIntegrityPolicy": "Code Integrity Policy value",
"bootRevisionListInfo": "Boot Revision List Info value",
"operatingSystemRevListInfo": "Operating System Rev List Info value",
"healthStatusMismatchInfo": "Health Status Mismatch Info value",
"healthAttestationSupportedStatus": "Health Attestation Supported Status value"
},
"subscriberCarrier": "Subscriber Carrier value",
"meid": "Meid value",
"totalStorageSpaceInBytes": 8,
"freeStorageSpaceInBytes": 7,
"managedDeviceName": "Managed Device Name value",
"partnerReportedThreatState": "activated",
"requireUserEnrollmentApproval": true,
"managementCertificateExpirationDate": "2016-12-31T23:57:59.9789653-08:00",
"iccid": "Iccid value",
"udid": "Udid value",
"notes": "Notes value",
"ethernetMacAddress": "Ethernet Mac Address value",
"physicalMemoryInBytes": 5,
"enrollmentProfileName": "Enrollment Profile Name value"
}
响应
下面是一个响应示例。 注意:为简洁起见,可能会截断此处显示的响应对象。 将从实际调用中返回所有属性。
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 5107
{
"@odata.type": "#microsoft.graph.managedDevice",
"id": "705c034c-034c-705c-4c03-5c704c035c70",
"userId": "User Id value",
"deviceName": "Device Name value",
"managedDeviceOwnerType": "company",
"deviceActionResults": [
{
"@odata.type": "microsoft.graph.deviceActionResult",
"actionName": "Action Name value",
"actionState": "pending",
"startDateTime": "2016-12-31T23:58:46.7156189-08:00",
"lastUpdatedDateTime": "2017-01-01T00:00:56.8321556-08:00"
}
],
"enrolledDateTime": "2016-12-31T23:59:43.797191-08:00",
"lastSyncDateTime": "2017-01-01T00:02:49.3205976-08:00",
"operatingSystem": "Operating System value",
"complianceState": "compliant",
"jailBroken": "Jail Broken value",
"managementAgent": "mdm",
"osVersion": "Os Version value",
"easActivated": true,
"easDeviceId": "Eas Device Id value",
"easActivationDateTime": "2016-12-31T23:59:43.4878784-08:00",
"azureADRegistered": true,
"deviceEnrollmentType": "userEnrollment",
"activationLockBypassCode": "Activation Lock Bypass Code value",
"emailAddress": "Email Address value",
"azureADDeviceId": "Azure ADDevice Id value",
"deviceRegistrationState": "registered",
"deviceCategoryDisplayName": "Device Category Display Name value",
"isSupervised": true,
"exchangeLastSuccessfulSyncDateTime": "2017-01-01T00:00:45.8803083-08:00",
"exchangeAccessState": "unknown",
"exchangeAccessStateReason": "unknown",
"remoteAssistanceSessionUrl": "https://example.com/remoteAssistanceSessionUrl/",
"remoteAssistanceSessionErrorDetails": "Remote Assistance Session Error Details value",
"isEncrypted": true,
"userPrincipalName": "User Principal Name value",
"model": "Model value",
"manufacturer": "Manufacturer value",
"imei": "Imei value",
"complianceGracePeriodExpirationDateTime": "2016-12-31T23:56:44.951111-08:00",
"serialNumber": "Serial Number value",
"phoneNumber": "Phone Number value",
"androidSecurityPatchLevel": "Android Security Patch Level value",
"userDisplayName": "User Display Name value",
"configurationManagerClientEnabledFeatures": {
"@odata.type": "microsoft.graph.configurationManagerClientEnabledFeatures",
"inventory": true,
"modernApps": true,
"resourceAccess": true,
"deviceConfiguration": true,
"compliancePolicy": true,
"windowsUpdateForBusiness": true
},
"wiFiMacAddress": "Wi Fi Mac Address value",
"deviceHealthAttestationState": {
"@odata.type": "microsoft.graph.deviceHealthAttestationState",
"lastUpdateDateTime": "Last Update Date Time value",
"contentNamespaceUrl": "https://example.com/contentNamespaceUrl/",
"deviceHealthAttestationStatus": "Device Health Attestation Status value",
"contentVersion": "Content Version value",
"issuedDateTime": "2016-12-31T23:58:22.1231038-08:00",
"attestationIdentityKey": "Attestation Identity Key value",
"resetCount": 10,
"restartCount": 12,
"dataExcutionPolicy": "Data Excution Policy value",
"bitLockerStatus": "Bit Locker Status value",
"bootManagerVersion": "Boot Manager Version value",
"codeIntegrityCheckVersion": "Code Integrity Check Version value",
"secureBoot": "Secure Boot value",
"bootDebugging": "Boot Debugging value",
"operatingSystemKernelDebugging": "Operating System Kernel Debugging value",
"codeIntegrity": "Code Integrity value",
"testSigning": "Test Signing value",
"safeMode": "Safe Mode value",
"windowsPE": "Windows PE value",
"earlyLaunchAntiMalwareDriverProtection": "Early Launch Anti Malware Driver Protection value",
"virtualSecureMode": "Virtual Secure Mode value",
"pcrHashAlgorithm": "Pcr Hash Algorithm value",
"bootAppSecurityVersion": "Boot App Security Version value",
"bootManagerSecurityVersion": "Boot Manager Security Version value",
"tpmVersion": "Tpm Version value",
"pcr0": "Pcr0 value",
"secureBootConfigurationPolicyFingerPrint": "Secure Boot Configuration Policy Finger Print value",
"codeIntegrityPolicy": "Code Integrity Policy value",
"bootRevisionListInfo": "Boot Revision List Info value",
"operatingSystemRevListInfo": "Operating System Rev List Info value",
"healthStatusMismatchInfo": "Health Status Mismatch Info value",
"healthAttestationSupportedStatus": "Health Attestation Supported Status value"
},
"subscriberCarrier": "Subscriber Carrier value",
"meid": "Meid value",
"totalStorageSpaceInBytes": 8,
"freeStorageSpaceInBytes": 7,
"managedDeviceName": "Managed Device Name value",
"partnerReportedThreatState": "activated",
"requireUserEnrollmentApproval": true,
"managementCertificateExpirationDate": "2016-12-31T23:57:59.9789653-08:00",
"iccid": "Iccid value",
"udid": "Udid value",
"notes": "Notes value",
"ethernetMacAddress": "Ethernet Mac Address value",
"physicalMemoryInBytes": 5,
"enrollmentProfileName": "Enrollment Profile Name value"
}