deviceHealthScript の更新

名前空間: microsoft.graph

重要: Microsoft Graph /beta バージョンの API は変更される場合があります。実稼働での使用はサポートされていません。

注: Intune 用 Microsoft Graph API には、テナントの 有効な Intune ライセンスが必要です。

deviceHealthScript オブジェクトのプロパティを更新します。

前提条件

この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。

アクセス許可の種類 アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校アカウント) DeviceManagementConfiguration.Read.All, DeviceManagementConfiguration.ReadWrite.All
委任 (個人用 Microsoft アカウント) サポートされていません。
アプリケーション DeviceManagementConfiguration.Read.All, DeviceManagementConfiguration.ReadWrite.All

HTTP 要求

PATCH /deviceManagement/deviceHealthScripts/{deviceHealthScriptId}

要求ヘッダー

ヘッダー
Authorization ベアラー <トークン> が必要です。
承諾 application/json

要求本文

要求本文で 、deviceHealthScript オブジェクトの JSON 表記を指定します。

次の表に 、deviceHealthScriptを作成するときに必要なプロパティを示します。

プロパティ 説明
id 文字列 デバイス正常性スクリプトの一意識別子
publisher String デバイス正常性スクリプト発行元の名前
version String デバイス正常性スクリプトのバージョン
displayName 文字列 デバイス正常性スクリプトの名前
description String デバイス正常性スクリプトの説明
detectionScriptContent Binary 検出 powershell スクリプトのコンテンツ全体
remediationScriptContent Binary 修復 powershell スクリプトのコンテンツ全体
createdDateTime DateTimeOffset デバイス正常性スクリプトが作成された時刻のタイムスタンプ。 このプロパティに値を設定するには、 SetExtrusionDirection メソッドを適用します。
lastModifiedDateTime DateTimeOffset デバイス正常性スクリプトが変更された時刻のタイムスタンプ。 このプロパティに値を設定するには、 SetExtrusionDirection メソッドを適用します。
runAsAccount runAsAccountType 実行コンテキストの種類を示します。 可能な値は、systemuser です。
enforceSignatureCheck ブール値 スクリプト署名のチェックが必要かどうかを示す
runAs32Bit Boolean PowerShell スクリプトを 32 ビットとして実行するかどうかを示す
roleScopeTagIds String collection デバイス正常性スクリプトのスコープ タグの一覧
isGlobalScript ブール値 これが Microsoft プロプライエタリ スクリプトかどうかを決定します。 独自のスクリプトは読み取り専用です
highestAvailableVersion String Microsoft Proprietary スクリプトで使用可能な最高バージョン
detectionScriptParameters deviceHealthScriptParameter コレクション ComplexType DetectionScriptParameters オブジェクトの一覧。
remediationScriptParameters deviceHealthScriptParameter コレクション ComplexType RemediationScriptParameters オブジェクトの一覧。

応答

成功した場合、このメソッドは応答コードと、応答本文で 200 OK 更新された deviceHealthScript オブジェクトを返します。

要求

以下は、要求の例です。

PATCH https://graph.microsoft.com/beta/deviceManagement/deviceHealthScripts/{deviceHealthScriptId}
Content-type: application/json
Content-length: 1221

{
  "@odata.type": "#microsoft.graph.deviceHealthScript",
  "publisher": "Publisher value",
  "version": "Version value",
  "displayName": "Display Name value",
  "description": "Description value",
  "detectionScriptContent": "ZGV0ZWN0aW9uU2NyaXB0Q29udGVudA==",
  "remediationScriptContent": "cmVtZWRpYXRpb25TY3JpcHRDb250ZW50",
  "runAsAccount": "user",
  "enforceSignatureCheck": true,
  "runAs32Bit": true,
  "roleScopeTagIds": [
    "Role Scope Tag Ids value"
  ],
  "isGlobalScript": true,
  "highestAvailableVersion": "Highest Available Version value",
  "detectionScriptParameters": [
    {
      "@odata.type": "microsoft.graph.deviceHealthScriptStringParameter",
      "name": "Name value",
      "description": "Description value",
      "isRequired": true,
      "applyDefaultValueWhenNotAssigned": true,
      "defaultValue": "Default Value value"
    }
  ],
  "remediationScriptParameters": [
    {
      "@odata.type": "microsoft.graph.deviceHealthScriptStringParameter",
      "name": "Name value",
      "description": "Description value",
      "isRequired": true,
      "applyDefaultValueWhenNotAssigned": true,
      "defaultValue": "Default Value value"
    }
  ]
}

応答

以下は、応答の例です。注:簡潔にするために、ここに示す応答オブジェクトは切り詰められている場合があります。すべてのプロパティは実際の呼び出しから返されます。

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

{
  "@odata.type": "#microsoft.graph.deviceHealthScript",
  "id": "bcb60502-0502-bcb6-0205-b6bc0205b6bc",
  "publisher": "Publisher value",
  "version": "Version value",
  "displayName": "Display Name value",
  "description": "Description value",
  "detectionScriptContent": "ZGV0ZWN0aW9uU2NyaXB0Q29udGVudA==",
  "remediationScriptContent": "cmVtZWRpYXRpb25TY3JpcHRDb250ZW50",
  "createdDateTime": "2017-01-01T00:02:43.5775965-08:00",
  "lastModifiedDateTime": "2017-01-01T00:00:35.1329464-08:00",
  "runAsAccount": "user",
  "enforceSignatureCheck": true,
  "runAs32Bit": true,
  "roleScopeTagIds": [
    "Role Scope Tag Ids value"
  ],
  "isGlobalScript": true,
  "highestAvailableVersion": "Highest Available Version value",
  "detectionScriptParameters": [
    {
      "@odata.type": "microsoft.graph.deviceHealthScriptStringParameter",
      "name": "Name value",
      "description": "Description value",
      "isRequired": true,
      "applyDefaultValueWhenNotAssigned": true,
      "defaultValue": "Default Value value"
    }
  ],
  "remediationScriptParameters": [
    {
      "@odata.type": "microsoft.graph.deviceHealthScriptStringParameter",
      "name": "Name value",
      "description": "Description value",
      "isRequired": true,
      "applyDefaultValueWhenNotAssigned": true,
      "defaultValue": "Default Value value"
    }
  ]
}