PATCH https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations/{deviceConfigurationId}
Content-type: application/json
Content-length: 860
{
"@odata.type": "#microsoft.graph.sharedPCConfiguration",
"description": "Description value",
"displayName": "Display Name value",
"version": 7,
"accountManagerPolicy": {
"@odata.type": "microsoft.graph.sharedPCAccountManagerPolicy",
"accountDeletionPolicy": "diskSpaceThreshold",
"cacheAccountsAboveDiskFreePercentage": 4,
"inactiveThresholdDays": 5,
"removeAccountsBelowDiskFreePercentage": 5
},
"allowedAccounts": "domain",
"allowLocalStorage": true,
"disableAccountManager": true,
"disableEduPolicies": true,
"disablePowerPolicies": true,
"disableSignInOnResume": true,
"enabled": true,
"idleTimeBeforeSleepInSeconds": 12,
"kioskAppDisplayName": "Kiosk App Display Name value",
"kioskAppUserModelId": "Kiosk App User Model Id value",
"maintenanceStartTime": "11:59:24.7240000"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new SharedPCConfiguration
{
OdataType = "#microsoft.graph.sharedPCConfiguration",
Description = "Description value",
DisplayName = "Display Name value",
Version = 7,
AccountManagerPolicy = new SharedPCAccountManagerPolicy
{
OdataType = "microsoft.graph.sharedPCAccountManagerPolicy",
AccountDeletionPolicy = SharedPCAccountDeletionPolicyType.DiskSpaceThreshold,
CacheAccountsAboveDiskFreePercentage = 4,
InactiveThresholdDays = 5,
RemoveAccountsBelowDiskFreePercentage = 5,
},
AllowedAccounts = SharedPCAllowedAccountType.Domain,
AllowLocalStorage = true,
DisableAccountManager = true,
DisableEduPolicies = true,
DisablePowerPolicies = true,
DisableSignInOnResume = true,
Enabled = true,
IdleTimeBeforeSleepInSeconds = 12,
KioskAppDisplayName = "Kiosk App Display Name value",
KioskAppUserModelId = "Kiosk App User Model Id value",
MaintenanceStartTime = new Time(DateTime.Parse("11:59:24.7240000")),
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.DeviceConfigurations["{deviceConfiguration-id}"].PatchAsync(requestBody);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
mgc device-management device-configurations patch --device-configuration-id {deviceConfiguration-id} --body '{\
"@odata.type": "#microsoft.graph.sharedPCConfiguration",\
"description": "Description value",\
"displayName": "Display Name value",\
"version": 7,\
"accountManagerPolicy": {\
"@odata.type": "microsoft.graph.sharedPCAccountManagerPolicy",\
"accountDeletionPolicy": "diskSpaceThreshold",\
"cacheAccountsAboveDiskFreePercentage": 4,\
"inactiveThresholdDays": 5,\
"removeAccountsBelowDiskFreePercentage": 5\
},\
"allowedAccounts": "domain",\
"allowLocalStorage": true,\
"disableAccountManager": true,\
"disableEduPolicies": true,\
"disablePowerPolicies": true,\
"disableSignInOnResume": true,\
"enabled": true,\
"idleTimeBeforeSleepInSeconds": 12,\
"kioskAppDisplayName": "Kiosk App Display Name value",\
"kioskAppUserModelId": "Kiosk App User Model Id value",\
"maintenanceStartTime": "11:59:24.7240000"\
}\
'
有关如何将 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"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewDeviceConfiguration()
description := "Description value"
requestBody.SetDescription(&description)
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
version := int32(7)
requestBody.SetVersion(&version)
accountManagerPolicy := graphmodels.NewSharedPCAccountManagerPolicy()
accountDeletionPolicy := graphmodels.DISKSPACETHRESHOLD_SHAREDPCACCOUNTDELETIONPOLICYTYPE
accountManagerPolicy.SetAccountDeletionPolicy(&accountDeletionPolicy)
cacheAccountsAboveDiskFreePercentage := int32(4)
accountManagerPolicy.SetCacheAccountsAboveDiskFreePercentage(&cacheAccountsAboveDiskFreePercentage)
inactiveThresholdDays := int32(5)
accountManagerPolicy.SetInactiveThresholdDays(&inactiveThresholdDays)
removeAccountsBelowDiskFreePercentage := int32(5)
accountManagerPolicy.SetRemoveAccountsBelowDiskFreePercentage(&removeAccountsBelowDiskFreePercentage)
requestBody.SetAccountManagerPolicy(accountManagerPolicy)
allowedAccounts := graphmodels.DOMAIN_SHAREDPCALLOWEDACCOUNTTYPE
requestBody.SetAllowedAccounts(&allowedAccounts)
allowLocalStorage := true
requestBody.SetAllowLocalStorage(&allowLocalStorage)
disableAccountManager := true
requestBody.SetDisableAccountManager(&disableAccountManager)
disableEduPolicies := true
requestBody.SetDisableEduPolicies(&disableEduPolicies)
disablePowerPolicies := true
requestBody.SetDisablePowerPolicies(&disablePowerPolicies)
disableSignInOnResume := true
requestBody.SetDisableSignInOnResume(&disableSignInOnResume)
enabled := true
requestBody.SetEnabled(&enabled)
idleTimeBeforeSleepInSeconds := int32(12)
requestBody.SetIdleTimeBeforeSleepInSeconds(&idleTimeBeforeSleepInSeconds)
kioskAppDisplayName := "Kiosk App Display Name value"
requestBody.SetKioskAppDisplayName(&kioskAppDisplayName)
kioskAppUserModelId := "Kiosk App User Model Id value"
requestBody.SetKioskAppUserModelId(&kioskAppUserModelId)
maintenanceStartTime := 11:59:24.7240000
requestBody.SetMaintenanceStartTime(&maintenanceStartTime)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
deviceConfigurations, err := graphClient.DeviceManagement().DeviceConfigurations().ByDeviceConfigurationId("deviceConfiguration-id").Patch(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);
SharedPCConfiguration deviceConfiguration = new SharedPCConfiguration();
deviceConfiguration.setOdataType("#microsoft.graph.sharedPCConfiguration");
deviceConfiguration.setDescription("Description value");
deviceConfiguration.setDisplayName("Display Name value");
deviceConfiguration.setVersion(7);
SharedPCAccountManagerPolicy accountManagerPolicy = new SharedPCAccountManagerPolicy();
accountManagerPolicy.setOdataType("microsoft.graph.sharedPCAccountManagerPolicy");
accountManagerPolicy.setAccountDeletionPolicy(SharedPCAccountDeletionPolicyType.DiskSpaceThreshold);
accountManagerPolicy.setCacheAccountsAboveDiskFreePercentage(4);
accountManagerPolicy.setInactiveThresholdDays(5);
accountManagerPolicy.setRemoveAccountsBelowDiskFreePercentage(5);
deviceConfiguration.setAccountManagerPolicy(accountManagerPolicy);
deviceConfiguration.setAllowedAccounts(EnumSet.of(SharedPCAllowedAccountType.Domain));
deviceConfiguration.setAllowLocalStorage(true);
deviceConfiguration.setDisableAccountManager(true);
deviceConfiguration.setDisableEduPolicies(true);
deviceConfiguration.setDisablePowerPolicies(true);
deviceConfiguration.setDisableSignInOnResume(true);
deviceConfiguration.setEnabled(true);
deviceConfiguration.setIdleTimeBeforeSleepInSeconds(12);
deviceConfiguration.setKioskAppDisplayName("Kiosk App Display Name value");
deviceConfiguration.setKioskAppUserModelId("Kiosk App User Model Id value");
LocalTime maintenanceStartTime = LocalTime.parse("11:59:24.7240000");
deviceConfiguration.setMaintenanceStartTime(maintenanceStartTime);
DeviceConfiguration result = graphClient.deviceManagement().deviceConfigurations().byDeviceConfigurationId("{deviceConfiguration-id}").patch(deviceConfiguration);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
const deviceConfiguration = {
'@odata.type': '#microsoft.graph.sharedPCConfiguration',
description: 'Description value',
displayName: 'Display Name value',
version: 7,
accountManagerPolicy: {
'@odata.type': 'microsoft.graph.sharedPCAccountManagerPolicy',
accountDeletionPolicy: 'diskSpaceThreshold',
cacheAccountsAboveDiskFreePercentage: 4,
inactiveThresholdDays: 5,
removeAccountsBelowDiskFreePercentage: 5
},
allowedAccounts: 'domain',
allowLocalStorage: true,
disableAccountManager: true,
disableEduPolicies: true,
disablePowerPolicies: true,
disableSignInOnResume: true,
enabled: true,
idleTimeBeforeSleepInSeconds: 12,
kioskAppDisplayName: 'Kiosk App Display Name value',
kioskAppUserModelId: 'Kiosk App User Model Id value',
maintenanceStartTime: '11:59:24.7240000'
};
await client.api('/deviceManagement/deviceConfigurations/{deviceConfigurationId}')
.update(deviceConfiguration);
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\SharedPCConfiguration;
use Microsoft\Graph\Generated\Models\SharedPCAccountManagerPolicy;
use Microsoft\Graph\Generated\Models\SharedPCAccountDeletionPolicyType;
use Microsoft\Graph\Generated\Models\SharedPCAllowedAccountType;
use Microsoft\Kiota\Abstractions\Types\Time;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SharedPCConfiguration();
$requestBody->setOdataType('#microsoft.graph.sharedPCConfiguration');
$requestBody->setDescription('Description value');
$requestBody->setDisplayName('Display Name value');
$requestBody->setVersion(7);
$accountManagerPolicy = new SharedPCAccountManagerPolicy();
$accountManagerPolicy->setOdataType('microsoft.graph.sharedPCAccountManagerPolicy');
$accountManagerPolicy->setAccountDeletionPolicy(new SharedPCAccountDeletionPolicyType('diskSpaceThreshold'));
$accountManagerPolicy->setCacheAccountsAboveDiskFreePercentage(4);
$accountManagerPolicy->setInactiveThresholdDays(5);
$accountManagerPolicy->setRemoveAccountsBelowDiskFreePercentage(5);
$requestBody->setAccountManagerPolicy($accountManagerPolicy);
$requestBody->setAllowedAccounts(new SharedPCAllowedAccountType('domain'));
$requestBody->setAllowLocalStorage(true);
$requestBody->setDisableAccountManager(true);
$requestBody->setDisableEduPolicies(true);
$requestBody->setDisablePowerPolicies(true);
$requestBody->setDisableSignInOnResume(true);
$requestBody->setEnabled(true);
$requestBody->setIdleTimeBeforeSleepInSeconds(12);
$requestBody->setKioskAppDisplayName('Kiosk App Display Name value');
$requestBody->setKioskAppUserModelId('Kiosk App User Model Id value');
$requestBody->setMaintenanceStartTime(new Time('11:59:24.7240000'));
$result = $graphServiceClient->deviceManagement()->deviceConfigurations()->byDeviceConfigurationId('deviceConfiguration-id')->patch($requestBody)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
Import-Module Microsoft.Graph.DeviceManagement
$params = @{
"@odata.type" = "#microsoft.graph.sharedPCConfiguration"
description = "Description value"
displayName = "Display Name value"
version = 7
accountManagerPolicy = @{
"@odata.type" = "microsoft.graph.sharedPCAccountManagerPolicy"
accountDeletionPolicy = "diskSpaceThreshold"
cacheAccountsAboveDiskFreePercentage =
inactiveThresholdDays =
removeAccountsBelowDiskFreePercentage =
}
allowedAccounts = "domain"
allowLocalStorage = $true
disableAccountManager = $true
disableEduPolicies = $true
disablePowerPolicies = $true
disableSignInOnResume = $true
enabled = $true
idleTimeBeforeSleepInSeconds =
kioskAppDisplayName = "Kiosk App Display Name value"
kioskAppUserModelId = "Kiosk App User Model Id value"
maintenanceStartTime = "11:59:24.7240000"
}
Update-MgDeviceManagementDeviceConfiguration -DeviceConfigurationId $deviceConfigurationId -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.models.shared_p_c_configuration import SharedPCConfiguration
from msgraph.generated.models.shared_p_c_account_manager_policy import SharedPCAccountManagerPolicy
from msgraph.generated.models.shared_p_c_account_deletion_policy_type import SharedPCAccountDeletionPolicyType
from msgraph.generated.models.shared_p_c_allowed_account_type import SharedPCAllowedAccountType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = SharedPCConfiguration(
odata_type = "#microsoft.graph.sharedPCConfiguration",
description = "Description value",
display_name = "Display Name value",
version = 7,
account_manager_policy = SharedPCAccountManagerPolicy(
odata_type = "microsoft.graph.sharedPCAccountManagerPolicy",
account_deletion_policy = SharedPCAccountDeletionPolicyType.DiskSpaceThreshold,
cache_accounts_above_disk_free_percentage = 4,
inactive_threshold_days = 5,
remove_accounts_below_disk_free_percentage = 5,
),
allowed_accounts = SharedPCAllowedAccountType.Domain,
allow_local_storage = True,
disable_account_manager = True,
disable_edu_policies = True,
disable_power_policies = True,
disable_sign_in_on_resume = True,
enabled = True,
idle_time_before_sleep_in_seconds = 12,
kiosk_app_display_name = "Kiosk App Display Name value",
kiosk_app_user_model_id = "Kiosk App User Model Id value",
maintenance_start_time = "11:59:24.7240000",
)
result = await graph_client.device_management.device_configurations.by_device_configuration_id('deviceConfiguration-id').patch(request_body)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。