Skip to main content

graph openextension set

Updates an open extension for a resource

Usage

m365 graph openextension set [options]

Options

-n, --name <name>

The name of the open extension.

-i, --resourceId <resourceId>

The Id of the resource for which to update the open extension.

-t, --resourceType <resourceType>

The type of resource. Allowed values are user, group, device, organization.

-k, --keepUnchangedProperties

Keeps unspecified properties. Without this flag, any property that is not updated will be removed from the extension.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, permissions, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks

This command allows using unknown options to update custom data of the open extension.

When updating an open extension to a user, it's possible to use the UPN as the resourceId.

Escaping JSON in PowerShell

When updating 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.

info

If a property of the open extension is not specified, the property is removed from the open extension.

If a property of the open extension is not specified and keepUnchangedProperties is specified, the property will be kept in the open extension.

Examples

Updates an open extension for a user specified by id

m365 graph openextension set --userId eb77fbcf-6fe8-458b-985d-1747284793bc --name 'com.contoso.roamingSettings' --resourceType user --theme dark --color red --language English

Updates an open extension for a user specified by UPN

m365 graph openextension set --userName john.doe@contoso.com --name 'com.contoso.roamingSettings' --resourceType user --theme dark --color red --language English

Updates an open extension for a group specified by id, one of the property represents a JSON object

m365 graph openextension set --resourceId c956e711-f074-40c3-8431-fbd69bb67d9c --name 'com.contoso.roamingSettings' --resourceType group --settings '{"theme": "dark", "color": "red" }'

Updates an open extension, but keeps the properties that are not specified

m365 graph openextension set --userId eb77fbcf-6fe8-458b-985d-1747284793bc --name 'com.contoso.roamingSettings' --resourceType user --color red --keepUnchangedProperties

Updates an open extension, but removes the properties that are not specified

m365 graph openextension set --userId eb77fbcf-6fe8-458b-985d-1747284793bc --name 'com.contoso.roamingSettings' --resourceType user --color red

Clears the value of the property

m365 graph openextension set --userId eb77fbcf-6fe8-458b-985d-1747284793bc --name 'com.contoso.roamingSettings' --resourceType user --theme ""

Response

The command won't return a response on success.

More information