graph openextension add
Adds an open extension to a resource
Usage
m365 graph openextension add [options]
Options
-n, --name <name>
The name of the open extension.
-i, --resourceId <resourceId>
The Id of the resource for which the extension is created.
-t, --resourceType <resourceType>
The resource type for which the extension is created. Allowed values are
user
,group
,device
,organization
.
-h, --help [help]
Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options
,examples
,remarks
,response
,full
. Default isoptions
.--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]
Output type.
json
,text
,csv
,md
,none
. Defaultjson
.--verbose
Runs command with verbose logging.
--debug
Runs command with debug logging.
Remarks
This command allows using unknown options to add custom data to the open extension.
When adding an open extension to a user, it's possible to use the UPN as the resourceId.
When creating open extensions it's possible to enter a JSON string. In PowerShell 5 to 7.2 specific escaping rules apply due to an issue. Remember that you can also use file tokens instead.
Examples
Create a new open extension for a user specified by id. Extension properties are specified by unknown options.
m365 graph openextension add --resourceId eb77fbcf-6fe8-458b-985d-1747284793bc --resourceType user --name 'com.contoso.roamingSettings' --theme dark --color red --language English
Create a new open extension for a user specified by userName. Extension properties are specified by unknown options.
m365 graph openextension add --resourceId adelev@contoso.com --resourceType user --name 'com.contoso.roamingSettings' --theme dark --color red --language English
Create a new open extension for a group, one of the property represents a JSON object
m365 graph openextension add --resourceId eb77fbcf-6fe8-458b-985d-1747284793bc --resourceType group --name 'com.contoso.roamingSettings' --settings '{"theme": "dark", "color": "red", "language": "English"}' --supportedSystem 'Linux'
Response
- JSON
- Text
- CSV
- Markdown
{
"extensionName": "com.contoso.roamingSettings",
"settings": {
"theme": "dark",
"color": "red",
"language": "English"
},
"supportedSystem": "Linux",
"id": "com.contoso.roamingSettings"
}
extensionName : com.contoso.roamingSettings
id : com.contoso.roamingSettings
settings : {"theme":"dark","color":"red","language":"English"}
supportedSystem: Linux
extensionName,supportedSystem,id
com.contoso.roamingSettings,Linux,com.contoso.roamingSettings
# graph openextension add --name "com.contoso.roamingSettings" --resourceId "01b62bc5-9701-4f93-9587-9d1ea58a086d" --resourceType "user" --settings "{"theme": "dark", "color": "red", "language": "English"}" --supportedSystem "Linux"
Date: 3/13/2025
## com.contoso.roamingSettings
Property | Value
---------|-------
extensionName | com.contoso.roamingSettings
supportedSystem | Linux
id | com.contoso.roamingSettings