|
| 1 | +import Global from '/docs/cmd/_global.mdx'; |
| 2 | +import Tabs from '@theme/Tabs'; |
| 3 | +import TabItem from '@theme/TabItem'; |
| 4 | + |
| 5 | +# graph directoryextension add |
| 6 | + |
| 7 | +Creates a new directory extension |
| 8 | + |
| 9 | +## Usage |
| 10 | + |
| 11 | +```sh |
| 12 | +m365 graph directoryextension add [options] |
| 13 | +``` |
| 14 | + |
| 15 | +## Options |
| 16 | + |
| 17 | +```md definition-list |
| 18 | +`-n, --name <name>` |
| 19 | +: The name of the directory extension. |
| 20 | + |
| 21 | +`--appId [appId]` |
| 22 | +: Application (client) ID of the Entra application where the directory extension is registered. Specify either `appId`, `appObjectId` or `appName`, but not multiple. |
| 23 | + |
| 24 | +`--appObjectId [appObjectId]` |
| 25 | +: Object ID of the Entra application where the directory extension is registered. Specify either `appId`, `appObjectId` or `appName`, but not multiple. |
| 26 | + |
| 27 | +`--appName [appName]` |
| 28 | +: The name of Entra application where the directory extension is registered. Specify either `appId`, `appObjectId` or `appName`, but not multiple. |
| 29 | + |
| 30 | +`--dataType <dataType>` |
| 31 | +: The data type of the value the extension property can hold. Possible values are: `Binary`, `Boolean`, `DateTime`, `Integer`, `LargeInteger` and `String`. |
| 32 | + |
| 33 | +`--targetObjects <targetObjects>` |
| 34 | +: Comma-separated list of Microsoft Graph resources that can use the extension. Possible values are: `User`, `Group`, `Application`, `AdministrativeUnit`, `Device` and `Organization`. |
| 35 | + |
| 36 | +`--isMultiValued` |
| 37 | +: Defines the directory extension as a multi-valued property. |
| 38 | +``` |
| 39 | + |
| 40 | +<Global /> |
| 41 | + |
| 42 | +## Examples |
| 43 | + |
| 44 | +Create a new directory extension of string type defined for user resource. |
| 45 | + |
| 46 | +```sh |
| 47 | +m365 graph directoryextension add --name gitHubWorkAccountName --appName ContosoApp --targetObjects User --dataType String |
| 48 | +``` |
| 49 | + |
| 50 | +Create a new multi-valued directory extension of integer type defined for device and application resource |
| 51 | + |
| 52 | +```sh |
| 53 | +m365 graph directoryextension add --name departmentIds --appId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --targetObjects 'Application,Device' --dataType Integer --isMultiValued |
| 54 | +``` |
| 55 | + |
| 56 | +## Response |
| 57 | + |
| 58 | +<Tabs> |
| 59 | + <TabItem value="JSON"> |
| 60 | + |
| 61 | + ```json |
| 62 | + { |
| 63 | + "id": "522817ae-5c95-4243-96c1-f85231fcbc1f", |
| 64 | + "deletedDateTime": null, |
| 65 | + "appDisplayName": "ContosoApp", |
| 66 | + "dataType": "String", |
| 67 | + "isMultiValued": false, |
| 68 | + "isSyncedFromOnPremises": false, |
| 69 | + "name": "extension_105be60b603845fea385e58772d9d630_githubworkaccount", |
| 70 | + "targetObjects": [ |
| 71 | + "User" |
| 72 | + ] |
| 73 | + } |
| 74 | + ``` |
| 75 | + |
| 76 | + </TabItem> |
| 77 | + <TabItem value="Text"> |
| 78 | + |
| 79 | + ```text |
| 80 | + appDisplayName : ContosoApp |
| 81 | + dataType : String |
| 82 | + deletedDateTime : null |
| 83 | + id : 01e77f60-3dde-4fa3-825b-cac8048994a8 |
| 84 | + isMultiValued : false |
| 85 | + isSyncedFromOnPremises: false |
| 86 | + name : extension_105be60b603845fea385e58772d9d630_githubworkaccount |
| 87 | + targetObjects : ["User"] |
| 88 | + ``` |
| 89 | + |
| 90 | + </TabItem> |
| 91 | + <TabItem value="CSV"> |
| 92 | + |
| 93 | + ```csv |
| 94 | + id,deletedDateTime,appDisplayName,dataType,isMultiValued,isSyncedFromOnPremises,name |
| 95 | + b0937b01-49ce-45c7-a52a-727954f092ea,,ContosoApp,String,,,extension_105be60b603845fea385e58772d9d630_githubworkaccount |
| 96 | + ``` |
| 97 | + |
| 98 | + </TabItem> |
| 99 | + <TabItem value="Markdown"> |
| 100 | + |
| 101 | + ```md |
| 102 | + # graph directoryextension add --debug "false" --verbose "false" --name "githubworkaccount" --appName "ContosoApp" --dataType "String" --targetObjects "User" |
| 103 | + |
| 104 | + Date: 9/8/2024 |
| 105 | + |
| 106 | + ## extension_105be60b603845fea385e58772d9d630_githubworkaccount (cec3c38e-3f4a-4ca8-9523-afa47016f51b) |
| 107 | + |
| 108 | + Property | Value| |
| 109 | + ---------|-------| |
| 110 | + id | cec3c38e-3f4a-4ca8-9523-afa47016f51b |
| 111 | + appDisplayName | ContosoApp |
| 112 | + dataType | String |
| 113 | + isMultiValued | false |
| 114 | + isSyncedFromOnPremises | false |
| 115 | + name | extension\_105be60b603845fea385e58772d9d630\_githubworkaccount |
| 116 | + ``` |
| 117 | + |
| 118 | + </TabItem> |
| 119 | +</Tabs> |
| 120 | + |
| 121 | +## More information |
| 122 | + |
| 123 | +- Directory extensions: https://learn.microsoft.com/graph/extensibility-overview#directory-microsoft-entra-id-extensions |
0 commit comments