Update a group setting

Update the properties of a specific group setting object.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Directory.ReadWrite.All, Directory.AccessAsUser.All
Delegated (personal Microsoft account) Not supported.
Application Directory.ReadWrite.All

HTTP request

Update a tenant-wide or group specific setting.

PATCH /groupSettings/{id}
PATCH /groups/{id}/settings/{id}

Optional request headers

Name Description
Authorization Bearer {token}. Required.
Content-Type application/json

Request body

In the request body, supply the values for relevant fields that should be updated.

Property Type Description
values settingValue collection The updated set of values. NOTE: You must supply the entire collection set. You cannot update a single set of values.

Response

If successful, this method returns a 204 No Content response code.

Example

Request

PATCH https://graph.microsoft.com/v1.0/groupSettings/{id}
Content-type: application/json
Content-length: 173

{
  "displayName": "displayName-value",
  "templateId": "templateId-value",
  "values": [
    {
      "name": "CustomBlockedWordsList",
      "value": ""
    },
    {
      "name": "EnableMSStandardBlockedWords",
      "value": "False"
    },
    {
      "name": "ClassificationDescriptions",
      "value": ""
    },
    {
      "name": "DefaultClassification",
      "value": ""
    },
    {
      "name": "PrefixSuffixNamingRequirement",
      "value": ""
    },
    {
      "name": "AllowGuestsToBeGroupOwner",
      "value": "False"
    },
    {
      "name": "AllowGuestsToAccessGroups",
      "value": "True"
    },
    {
      "name": "GuestUsageGuidelinesUrl",
      "value": ""
    },
    {
      "name": "GroupCreationAllowedGroupId",
      "value": "62e90394-69f5-4237-9190-012177145e10"
    },
    {
      "name": "AllowToAddGuests",
      "value": "True"
    },
    {
      "name": "UsageGuidelinesUrl",
      "value": ""
    },
    {
      "name": "ClassificationList",
      "value": ""
    },
    {
      "name": "EnableGroupCreation",
      "value": "True"
    }
  ]
}

Response

HTTP/1.1 204 No Content

SDK sample code


GraphServiceClient graphClient = new GraphServiceClient( authProvider );

var values = new SettingValue
{
	Name = "EnableGroupCreation",
	Value = "True",
};

var _values = new SettingValue
{
	Name = "ClassificationList",
	Value = "",
};

var __values = new SettingValue
{
	Name = "UsageGuidelinesUrl",
	Value = "",
};

var ___values = new SettingValue
{
	Name = "AllowToAddGuests",
	Value = "True",
};

var ____values = new SettingValue
{
	Name = "GroupCreationAllowedGroupId",
	Value = "62e90394-69f5-4237-9190-012177145e10",
};

var _____values = new SettingValue
{
	Name = "GuestUsageGuidelinesUrl",
	Value = "",
};

var ______values = new SettingValue
{
	Name = "AllowGuestsToAccessGroups",
	Value = "True",
};

var _______values = new SettingValue
{
	Name = "AllowGuestsToBeGroupOwner",
	Value = "False",
};

var ________values = new SettingValue
{
	Name = "PrefixSuffixNamingRequirement",
	Value = "",
};

var _________values = new SettingValue
{
	Name = "DefaultClassification",
	Value = "",
};

var __________values = new SettingValue
{
	Name = "ClassificationDescriptions",
	Value = "",
};

var ___________values = new SettingValue
{
	Name = "EnableMSStandardBlockedWords",
	Value = "False",
};

var ____________values = new SettingValue
{
	Name = "CustomBlockedWordsList",
	Value = "",
};

var valuesList = new List<SettingValue>();
valuesList.Add( ____________values );
valuesList.Add( ___________values );
valuesList.Add( __________values );
valuesList.Add( _________values );
valuesList.Add( ________values );
valuesList.Add( _______values );
valuesList.Add( ______values );
valuesList.Add( _____values );
valuesList.Add( ____values );
valuesList.Add( ___values );
valuesList.Add( __values );
valuesList.Add( _values );
valuesList.Add( values );

var groupSetting = new GroupSetting
{
	DisplayName = "displayName-value",
	TemplateId = "templateId-value",
	Values = valuesList,
};

await graphClient.GroupSettings["{id}"]
	.Request()
	.UpdateAsync(groupSetting);

Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.