Skip to content

Commit 3f3c7bc

Browse files
MartinM85martinlingstuyl
authored andcommitted
Adds command 'graph directoryextension add'. Closes #6316
1 parent 395d550 commit 3f3c7bc

File tree

8 files changed

+722
-1
lines changed

8 files changed

+722
-1
lines changed

.eslintrc.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const dictionary = [
3535
'definition',
3636
'dev',
3737
'details',
38+
'directory',
3839
'eligibility',
3940
'enterprise',
4041
'entra',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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

docs/src/config/sidebars.ts

+9
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,15 @@ const sidebars: SidebarsConfig = {
10891089
}
10901090
]
10911091
},
1092+
{
1093+
directoryextension: [
1094+
{
1095+
type: 'doc',
1096+
label: 'directoryextension add',
1097+
id: 'cmd/graph/directoryextension/directoryextension-add'
1098+
}
1099+
]
1100+
},
10921101
{
10931102
schemaextension: [
10941103
{

src/m365/graph/commands.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const prefix: string = 'graph';
22

33
export default {
44
CHANGELOG_LIST: `${prefix} changelog list`,
5+
DIRECTORYEXTENSION_ADD: `${prefix} directoryextension add`,
56
SCHEMAEXTENSION_ADD: `${prefix} schemaextension add`,
67
SCHEMAEXTENSION_GET: `${prefix} schemaextension get`,
78
SCHEMAEXTENSION_LIST: `${prefix} schemaextension list`,

0 commit comments

Comments
 (0)