POST https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/{managedDeviceId}/updateWindowsDeviceAccount
Content-type: application/json
Content-length: 532
{
"updateWindowsDeviceAccountActionParameter": {
"@odata.type": "microsoft.graph.updateWindowsDeviceAccountActionParameter",
"deviceAccount": {
"@odata.type": "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"
}
}
// 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);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
mgc device-management managed-devices update-windows-device-account post --managed-device-id {managedDevice-id} --body '{\
"updateWindowsDeviceAccountActionParameter": {\
"@odata.type": "microsoft.graph.updateWindowsDeviceAccountActionParameter",\
"deviceAccount": {\
"@odata.type": "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"\
}\
}\
'
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphdevicemanagement "github.com/microsoftgraph/msgraph-sdk-go/devicemanagement"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphdevicemanagement.NewUpdateWindowsDeviceAccountPostRequestBody()
updateWindowsDeviceAccountActionParameter := graphmodels.NewUpdateWindowsDeviceAccountActionParameter()
deviceAccount := graphmodels.NewWindowsDeviceAccount()
password := "Password value"
deviceAccount.SetPassword(&password)
updateWindowsDeviceAccountActionParameter.SetDeviceAccount(deviceAccount)
passwordRotationEnabled := true
updateWindowsDeviceAccountActionParameter.SetPasswordRotationEnabled(&passwordRotationEnabled)
calendarSyncEnabled := true
updateWindowsDeviceAccountActionParameter.SetCalendarSyncEnabled(&calendarSyncEnabled)
deviceAccountEmail := "Device Account Email value"
updateWindowsDeviceAccountActionParameter.SetDeviceAccountEmail(&deviceAccountEmail)
exchangeServer := "Exchange Server value"
updateWindowsDeviceAccountActionParameter.SetExchangeServer(&exchangeServer)
sessionInitiationProtocalAddress := "Session Initiation Protocal Address value"
updateWindowsDeviceAccountActionParameter.SetSessionInitiationProtocalAddress(&sessionInitiationProtocalAddress)
requestBody.SetUpdateWindowsDeviceAccountActionParameter(updateWindowsDeviceAccountActionParameter)
// To initialize your graphClient, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.DeviceManagement().ManagedDevices().ByManagedDeviceId("managedDevice-id").UpdateWindowsDeviceAccount().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// 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);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const updateWindowsDeviceAccount = {
updateWindowsDeviceAccountActionParameter: {
'@odata.type': 'microsoft.graph.updateWindowsDeviceAccountActionParameter',
deviceAccount: {
'@odata.type': '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'
}
};
await client.api('/deviceManagement/managedDevices/{managedDeviceId}/updateWindowsDeviceAccount')
.post(updateWindowsDeviceAccount);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\DeviceManagement\ManagedDevices\Item\UpdateWindowsDeviceAccount\UpdateWindowsDeviceAccountPostRequestBody;
use Microsoft\Graph\Generated\Models\UpdateWindowsDeviceAccountActionParameter;
use Microsoft\Graph\Generated\Models\WindowsDeviceAccount;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new UpdateWindowsDeviceAccountPostRequestBody();
$updateWindowsDeviceAccountActionParameter = new UpdateWindowsDeviceAccountActionParameter();
$updateWindowsDeviceAccountActionParameter->setOdataType('microsoft.graph.updateWindowsDeviceAccountActionParameter');
$updateWindowsDeviceAccountActionParameterDeviceAccount = new WindowsDeviceAccount();
$updateWindowsDeviceAccountActionParameterDeviceAccount->setOdataType('microsoft.graph.windowsDeviceAccount');
$updateWindowsDeviceAccountActionParameterDeviceAccount->setPassword('Password value');
$updateWindowsDeviceAccountActionParameter->setDeviceAccount($updateWindowsDeviceAccountActionParameterDeviceAccount);
$updateWindowsDeviceAccountActionParameter->setPasswordRotationEnabled(true);
$updateWindowsDeviceAccountActionParameter->setCalendarSyncEnabled(true);
$updateWindowsDeviceAccountActionParameter->setDeviceAccountEmail('Device Account Email value');
$updateWindowsDeviceAccountActionParameter->setExchangeServer('Exchange Server value');
$updateWindowsDeviceAccountActionParameter->setSessionInitiationProtocalAddress('Session Initiation Protocal Address value');
$requestBody->setUpdateWindowsDeviceAccountActionParameter($updateWindowsDeviceAccountActionParameter);
$graphServiceClient->deviceManagement()->managedDevices()->byManagedDeviceId('managedDevice-id')->updateWindowsDeviceAccount()->post($requestBody)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.DeviceManagement.Actions
$params = @{
updateWindowsDeviceAccountActionParameter = @{
"@odata.type" = "microsoft.graph.updateWindowsDeviceAccountActionParameter"
deviceAccount = @{
"@odata.type" = "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"
}
}
Update-MgDeviceManagementManagedDeviceWindowsDeviceAccount -ManagedDeviceId $managedDeviceId -BodyParameter $params
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.devicemanagement.manageddevices.item.update_windows_device_account.update_windows_device_account_post_request_body import UpdateWindowsDeviceAccountPostRequestBody
from msgraph.generated.models.update_windows_device_account_action_parameter import UpdateWindowsDeviceAccountActionParameter
from msgraph.generated.models.windows_device_account import WindowsDeviceAccount
# To initialize your graph_client, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = UpdateWindowsDeviceAccountPostRequestBody(
update_windows_device_account_action_parameter = UpdateWindowsDeviceAccountActionParameter(
odata_type = "microsoft.graph.updateWindowsDeviceAccountActionParameter",
device_account = WindowsDeviceAccount(
odata_type = "microsoft.graph.windowsDeviceAccount",
password = "Password value",
),
password_rotation_enabled = True,
calendar_sync_enabled = True,
device_account_email = "Device Account Email value",
exchange_server = "Exchange Server value",
session_initiation_protocal_address = "Session Initiation Protocal Address value",
),
)
await graph_client.device_management.managed_devices.by_managed_device_id('managedDevice-id').update_windows_device_account.post(request_body)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
以下は、応答の例です。 注: 簡潔にするために、ここに示す応答オブジェクトは切り詰められている場合があります。 実際の呼び出しではすべてのプロパティが返されます。