deviceCustomAttributeShellScript の更新

名前空間: microsoft.graph

重要:Microsoft は Intune /beta API をサポートしていますが、より頻繁に変更される可能性があります。 可能な場合は、バージョン v1.0 を使用することをお勧めします。 バージョン セレクターを使用して、バージョン v1.0 で API が使用できるかどうかを確認します。

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

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

この API は、次の国内クラウド展開で使用できます。

グローバル サービス 米国政府機関 L4 米国政府機関 L5 (DOD) 21Vianet が運営する中国

アクセス許可

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

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

HTTP 要求

PATCH /deviceManagement/deviceCustomAttributeShellScripts/{deviceCustomAttributeShellScriptId}

要求ヘッダー

ヘッダー
Authorization ベアラー {token}。 必須です。 認証と認可についての詳細をご覧ください。
承諾 application/json

要求本文

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

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

プロパティ 説明
id 文字列 カスタム属性エンティティの一意識別子。
customAttributeName 文字列 カスタム属性の名前。
customAttributeType deviceCustomAttributeValueType カスタム属性値の想定される型。 可能な値は integerstringdateTime です。
displayName 文字列 デバイス管理スクリプトの名前。
説明 String デバイス管理スクリプトの省略可能な説明。
scriptContent Binary スクリプト コンテンツ。
createdDateTime DateTimeOffset デバイス管理スクリプトが作成された日時。 このプロパティは読み取り専用です。
lastModifiedDateTime DateTimeOffset デバイス管理スクリプトが最後に変更された日時。 このプロパティは読み取り専用です。
runAsAccount runAsAccountType 実行コンテキストの種類を示します。 可能な値は、systemuser です。
fileName 文字列 スクリプト ファイル名。
roleScopeTagIds String collection この PowerShellScript インスタンスのスコープ タグ ID の一覧。

応答

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

要求

以下は、要求の例です。

PATCH https://graph.microsoft.com/beta/deviceManagement/deviceCustomAttributeShellScripts/{deviceCustomAttributeShellScriptId}
Content-type: application/json
Content-length: 413

{
  "@odata.type": "#microsoft.graph.deviceCustomAttributeShellScript",
  "customAttributeName": "Custom Attribute Name value",
  "customAttributeType": "string",
  "displayName": "Display Name value",
  "description": "Description value",
  "scriptContent": "c2NyaXB0Q29udGVudA==",
  "runAsAccount": "user",
  "fileName": "File Name value",
  "roleScopeTagIds": [
    "Role Scope Tag Ids value"
  ]
}

応答

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

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

{
  "@odata.type": "#microsoft.graph.deviceCustomAttributeShellScript",
  "id": "929d921b-921b-929d-1b92-9d921b929d92",
  "customAttributeName": "Custom Attribute Name value",
  "customAttributeType": "string",
  "displayName": "Display Name value",
  "description": "Description value",
  "scriptContent": "c2NyaXB0Q29udGVudA==",
  "createdDateTime": "2017-01-01T00:02:43.5775965-08:00",
  "lastModifiedDateTime": "2017-01-01T00:00:35.1329464-08:00",
  "runAsAccount": "user",
  "fileName": "File Name value",
  "roleScopeTagIds": [
    "Role Scope Tag Ids value"
  ]
}