// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new User
{
OdataType = "#microsoft.graph.user",
DeviceEnrollmentLimit = 5,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Users["{user-id}"].PatchAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc users patch --user-id {user-id} --body '{\
"@odata.type": "#microsoft.graph.user",\
"deviceEnrollmentLimit": 5\
}\
'
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
User user = new User();
user.setOdataType("#microsoft.graph.user");
user.setDeviceEnrollmentLimit(5);
User result = graphClient.users().byUserId("{user-id}").patch(user);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\User;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new User();
$requestBody->setOdataType('#microsoft.graph.user');
$requestBody->setDeviceEnrollmentLimit(5);
$result = $graphServiceClient->users()->byUserId('user-id')->patch($requestBody)->wait();