APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Update the properties of a specific directory setting object.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
For all settings except the Consent Policy Settings object
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
Directory.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
Directory.ReadWrite.All
For the Consent Policy Settings object
The following permissions are required to update the "Consent Policy Settings" directorySetting object.
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new DirectorySetting
{
Values = new List<SettingValue>
{
new SettingValue
{
Name = "CustomBlockedWordsList",
Value = "Contoso",
},
},
};
var result = await graphClient.Settings["{directorySetting-id}"].PatchAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewDirectorySetting()
settingValue := graphmodels.NewSettingValue()
name := "CustomBlockedWordsList"
settingValue.SetName(&name)
value := "Contoso"
settingValue.SetValue(&value)
values := []graphmodels.SettingValueable {
settingValue,
}
requestBody.SetValues(values)
result, err := graphClient.SettingsById("directorySetting-id").Patch(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new DirectorySetting();
$valuesSettingValue1 = new SettingValue();
$valuesSettingValue1->setName('CustomBlockedWordsList');
$valuesSettingValue1->setValue('Contoso');
$valuesArray []= $valuesSettingValue1;
$requestBody->setValues($valuesArray);
$requestResult = $graphServiceClient->settingsById('directorySetting-id')->patch($requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.