deviceCustomAttributeShellScript の作成

名前空間: microsoft.graph

大事な: Microsoft Graph /beta バージョンの API は変更される可能性があります。実稼働環境での使用はサポートされていません。

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

新しい deviceCustomAttributeShellScript オブジェクトを作成 します。

前提条件

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

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

HTTP 要求

POST /deviceManagement/deviceCustomAttributeShellScripts

要求ヘッダー

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

要求本文

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

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

プロパティ 種類 説明
id String カスタム属性エンティティの一意識別子。
customAttributeName String カスタム属性の名前。
customAttributeType deviceCustomAttributeValueType カスタム属性の値の予期される型。 可能な値は integerstringdateTime です。
displayName String デバイス管理スクリプトの名前。
description String デバイス管理スクリプトのオプションの説明。
scriptContent Binary スクリプトのコンテンツ。
createdDateTime DateTimeOffset デバイス管理スクリプトが作成された日時。 このプロパティに値を設定するには、 SetExtrusionDirection メソッドを適用します。
lastModifiedDateTime DateTimeOffset デバイス管理スクリプトが最後に変更された日時。 このプロパティに値を設定するには、 SetExtrusionDirection メソッドを適用します。
runAsAccount runAsAccountType 実行コンテキストの種類を示します。 可能な値は、systemuser です。
fileName String スクリプト ファイル名。
roleScopeTagIds String コレクション この PowerShellScript インスタンスのスコープ タグの一覧。

応答

成功した場合、このメソッドは応答コードと、応答本文の 201 Created deviceCustomAttributeShellScript オブジェクトを返します。

要求

以下は、要求の例です。

POST https://graph.microsoft.com/beta/deviceManagement/deviceCustomAttributeShellScripts
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 201 Created
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"
  ]
}