POST /deviceManagement/managedDevices/{managedDeviceId}/updateWindowsDeviceAccount
POST /deviceManagement/detectedApps/{detectedAppId}/managedDevices/{managedDeviceId}/updateWindowsDeviceAccount
POST /deviceManagement/detectedApps/{detectedAppId}/managedDevices/{managedDeviceId}/users/{userId}/managedDevices/{managedDeviceId}/updateWindowsDeviceAccount
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.DeviceManagement.ManagedDevices.Item.UpdateWindowsDeviceAccount;
using Microsoft.Graph.Models;
var requestBody = new UpdateWindowsDeviceAccountPostRequestBody
{
UpdateWindowsDeviceAccountActionParameter = new UpdateWindowsDeviceAccountActionParameter
{
OdataType = "microsoft.graph.updateWindowsDeviceAccountActionParameter",
DeviceAccount = new WindowsDeviceAccount
{
OdataType = "microsoft.graph.windowsDeviceAccount",
Password = "Password value",
},
PasswordRotationEnabled = true,
CalendarSyncEnabled = true,
DeviceAccountEmail = "Device Account Email value",
ExchangeServer = "Exchange Server value",
SessionInitiationProtocalAddress = "Session Initiation Protocal Address value",
},
};
// To initialize your graphClient, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.DeviceManagement.ManagedDevices["{managedDevice-id}"].UpdateWindowsDeviceAccount.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.devicemanagement.manageddevices.item.updatewindowsdeviceaccount.UpdateWindowsDeviceAccountPostRequestBody updateWindowsDeviceAccountPostRequestBody = new com.microsoft.graph.devicemanagement.manageddevices.item.updatewindowsdeviceaccount.UpdateWindowsDeviceAccountPostRequestBody();
UpdateWindowsDeviceAccountActionParameter updateWindowsDeviceAccountActionParameter = new UpdateWindowsDeviceAccountActionParameter();
updateWindowsDeviceAccountActionParameter.setOdataType("microsoft.graph.updateWindowsDeviceAccountActionParameter");
WindowsDeviceAccount deviceAccount = new WindowsDeviceAccount();
deviceAccount.setOdataType("microsoft.graph.windowsDeviceAccount");
deviceAccount.setPassword("Password value");
updateWindowsDeviceAccountActionParameter.setDeviceAccount(deviceAccount);
updateWindowsDeviceAccountActionParameter.setPasswordRotationEnabled(true);
updateWindowsDeviceAccountActionParameter.setCalendarSyncEnabled(true);
updateWindowsDeviceAccountActionParameter.setDeviceAccountEmail("Device Account Email value");
updateWindowsDeviceAccountActionParameter.setExchangeServer("Exchange Server value");
updateWindowsDeviceAccountActionParameter.setSessionInitiationProtocalAddress("Session Initiation Protocal Address value");
updateWindowsDeviceAccountPostRequestBody.setUpdateWindowsDeviceAccountActionParameter(updateWindowsDeviceAccountActionParameter);
graphClient.deviceManagement().managedDevices().byManagedDeviceId("{managedDevice-id}").updateWindowsDeviceAccount().post(updateWindowsDeviceAccountPostRequestBody);
Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.