更新 windowsProtectionState

命名空间:microsoft.graph

重要提示: Microsoft Graph /beta 版本下的 API 可能会更改;不支持生产使用。

注意: 适用于 Intune 的 Microsoft Graph API 需要适用于租户的 活动 Intune 许可证

更新 windowsProtectionState 对象 的属性。

先决条件

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限

权限类型 权限(从最低特权到最高特权)
委派(工作或学校帐户) DeviceManagementConfiguration.ReadWrite.All、DeviceManagementManagedDevices.ReadWrite.All
委派(个人 Microsoft 帐户) 不支持。
应用程序 DeviceManagementConfiguration.ReadWrite.All、DeviceManagementManagedDevices.ReadWrite.All

HTTP 请求

PATCH /deviceManagement/deviceManagementScripts/{deviceManagementScriptId}/deviceRunStates/{deviceManagementScriptDeviceStateId}/managedDevice/windowsProtectionState

请求标头

标头
Authorization Bearer <token>。必需。
接受 application/json

请求正文

在请求正文中,提供 windowsProtectionState 对象的 JSON 表示形式。

下表显示创建 windowsProtectionState时所需的属性。

属性 类型 说明
id String 设备保护状态对象的唯一标识符。 这是设备的设备 ID
malwareProtectionEnabled Boolean 反恶意软件是否已启用
deviceState windowsDeviceHealthState 计算机的状态 (如干净或挂起的完全扫描或挂起的重启等) 。 可取值为:cleanfullScanPendingrebootPendingmanualStepsPendingofflineScanPendingcritical
realTimeProtectionEnabled Boolean 实时保护是否已启用?
networkInspectionSystemEnabled Boolean 网络检查系统是否已启用?
quickScanOverdue Boolean 快速扫描是否过期?
fullScanOverdue Boolean 完全扫描是否过期?
signatureUpdateOverdue Boolean 签名是否过期?
rebootRequired Boolean 是否要求重新启动?
fullScanRequired Boolean 是否要求进行完全扫描?
engineVersion String 当前终结点保护引擎的版本
signatureVersion String 当前恶意软件定义版本
antiMalwareVersion String 当前反恶意软件版本
lastQuickScanDateTime DateTimeOffset 上次快速扫描日期/时间
lastFullScanDateTime DateTimeOffset 上次快速扫描日期/时间
lastQuickScanSignatureVersion String 上次快速扫描签名版本
lastFullScanSignatureVersion String 上次完全扫描签名版本
lastReportedDateTime DateTimeOffset 上次设备运行状况报告时间
productStatus windowsDefenderProductStatus 产品状态Windows Defender 防病毒。 可能的值是 noStatus serviceNotRunning serviceStartedWithoutMalwareProtection :、、、、、、、、、、。 pendingFullScanDueToThreatAction pendingRebootDueToThreatAction pendingManualStepsDueToThreatAction avSignaturesOutOfDate asSignaturesOutOfDate noQuickScanHappenedForSpecifiedPeriod noFullScanHappenedForSpecifiedPeriod systemInitiatedScanInProgress systemInitiatedCleanInProgress samplesPendingSubmission productRunningInEvaluationMode productRunningInNonGenuineMode productExpired offlineScanRequired serviceShutdownAsPartOfSystemShutdown threatRemediationFailedCritically threatRemediationFailedNonCritically noStatusFlagsSet platformOutOfDate platformUpdateInProgress platformAboutToBeOutdated signatureOrPlatformEndOfLifeIsPastOrIsImpending windowsSModeSignaturesInUseOnNonWin10SInstall
isVirtualMachine 布尔值 指示设备是否是虚拟机。
tamperProtectionEnabled Boolean 指示是否Windows Defender篡改保护功能。

响应

如果成功,此方法在响应正文中返回 响应代码和更新的 200 OK windowsProtectionState 对象。

示例

请求

下面是一个请求示例。

PATCH https://graph.microsoft.com/beta/deviceManagement/deviceManagementScripts/{deviceManagementScriptId}/deviceRunStates/{deviceManagementScriptDeviceStateId}/managedDevice/windowsProtectionState
Content-type: application/json
Content-length: 971

{
  "@odata.type": "#microsoft.graph.windowsProtectionState",
  "malwareProtectionEnabled": true,
  "deviceState": "fullScanPending",
  "realTimeProtectionEnabled": true,
  "networkInspectionSystemEnabled": true,
  "quickScanOverdue": true,
  "fullScanOverdue": true,
  "signatureUpdateOverdue": true,
  "rebootRequired": true,
  "fullScanRequired": true,
  "engineVersion": "Engine Version value",
  "signatureVersion": "Signature Version value",
  "antiMalwareVersion": "Anti Malware Version value",
  "lastQuickScanDateTime": "2016-12-31T23:58:27.5900669-08:00",
  "lastFullScanDateTime": "2017-01-01T00:01:44.9405639-08:00",
  "lastQuickScanSignatureVersion": "Last Quick Scan Signature Version value",
  "lastFullScanSignatureVersion": "Last Full Scan Signature Version value",
  "lastReportedDateTime": "2017-01-01T00:00:17.7769392-08:00",
  "productStatus": "serviceNotRunning",
  "isVirtualMachine": true,
  "tamperProtectionEnabled": true
}

响应

下面是一个响应示例。注意:为了简单起见,可能会将此处所示的响应对象截断。将从实际调用中返回所有属性。

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1020

{
  "@odata.type": "#microsoft.graph.windowsProtectionState",
  "id": "1ac6ea5a-ea5a-1ac6-5aea-c61a5aeac61a",
  "malwareProtectionEnabled": true,
  "deviceState": "fullScanPending",
  "realTimeProtectionEnabled": true,
  "networkInspectionSystemEnabled": true,
  "quickScanOverdue": true,
  "fullScanOverdue": true,
  "signatureUpdateOverdue": true,
  "rebootRequired": true,
  "fullScanRequired": true,
  "engineVersion": "Engine Version value",
  "signatureVersion": "Signature Version value",
  "antiMalwareVersion": "Anti Malware Version value",
  "lastQuickScanDateTime": "2016-12-31T23:58:27.5900669-08:00",
  "lastFullScanDateTime": "2017-01-01T00:01:44.9405639-08:00",
  "lastQuickScanSignatureVersion": "Last Quick Scan Signature Version value",
  "lastFullScanSignatureVersion": "Last Full Scan Signature Version value",
  "lastReportedDateTime": "2017-01-01T00:00:17.7769392-08:00",
  "productStatus": "serviceNotRunning",
  "isVirtualMachine": true,
  "tamperProtectionEnabled": true
}