// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new UxSetting
{
RestrictNonAdminAccess = NonAdminSetting.True,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Admin.Entra.UxSetting.PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewUxSetting()
restrictNonAdminAccess := graphmodels.TRUE_NONADMINSETTING
requestBody.SetRestrictNonAdminAccess(&restrictNonAdminAccess)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
uxSetting, err := graphClient.Admin().Entra().UxSetting().Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
UxSetting uxSetting = new UxSetting();
uxSetting.setRestrictNonAdminAccess(NonAdminSetting.True);
UxSetting result = graphClient.admin().entra().uxSetting().patch(uxSetting);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\UxSetting;
use Microsoft\Graph\Beta\Generated\Models\NonAdminSetting;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new UxSetting();
$requestBody->setRestrictNonAdminAccess(new NonAdminSetting('true'));
$result = $graphServiceClient->admin()->entra()->uxSetting()->patch($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.ux_setting import UxSetting
from msgraph_beta.generated.models.non_admin_setting import NonAdminSetting
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = UxSetting(
restrict_non_admin_access = NonAdminSetting.True,
)
result = await graph_client.admin.entra.ux_setting.patch(request_body)