Namespace: microsoft.graph
Note: The Microsoft Graph API for Intune requires an active Intune license for the tenant.
Update the properties of a sharedPCConfiguration object.
This API is available in the following national cloud deployments.
Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
✅ |
✅ |
✅ |
✅ |
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type |
Permissions (from least to most privileged) |
Delegated (work or school account) |
DeviceManagementConfiguration.ReadWrite.All |
Delegated (personal Microsoft account) |
Not supported. |
Application |
DeviceManagementConfiguration.ReadWrite.All |
HTTP Request
PATCH /deviceManagement/deviceConfigurations/{deviceConfigurationId}
Request body
In the request body, supply a JSON representation for the sharedPCConfiguration object.
The following table shows the properties that are required when you create the sharedPCConfiguration.
Property |
Type |
Description |
id |
String |
Key of the entity. Inherited from deviceConfiguration |
lastModifiedDateTime |
DateTimeOffset |
DateTime the object was last modified. Inherited from deviceConfiguration |
createdDateTime |
DateTimeOffset |
DateTime the object was created. Inherited from deviceConfiguration |
description |
String |
Admin provided description of the Device Configuration. Inherited from deviceConfiguration |
displayName |
String |
Admin provided name of the device configuration. Inherited from deviceConfiguration |
version |
Int32 |
Version of the device configuration. Inherited from deviceConfiguration |
accountManagerPolicy |
sharedPCAccountManagerPolicy |
Specifies how accounts are managed on a shared PC. Only applies when disableAccountManager is false. |
allowedAccounts |
sharedPCAllowedAccountType |
Indicates which type of accounts are allowed to use on a shared PC. Possible values are: guest , ___domain . |
allowLocalStorage |
Boolean |
Specifies whether local storage is allowed on a shared PC. |
disableAccountManager |
Boolean |
Disables the account manager for shared PC mode. |
disableEduPolicies |
Boolean |
Specifies whether the default shared PC education environment policies should be disabled. For Windows 10 RS2 and later, this policy will be applied without setting Enabled to true. |
disablePowerPolicies |
Boolean |
Specifies whether the default shared PC power policies should be disabled. |
disableSignInOnResume |
Boolean |
Disables the requirement to sign in whenever the device wakes up from sleep mode. |
enabled |
Boolean |
Enables shared PC mode and applies the shared pc policies. |
idleTimeBeforeSleepInSeconds |
Int32 |
Specifies the time in seconds that a device must sit idle before the PC goes to sleep. Setting this value to 0 prevents the sleep timeout from occurring. |
kioskAppDisplayName |
String |
Specifies the display text for the account shown on the sign-in screen which launches the app specified by SetKioskAppUserModelId. Only applies when KioskAppUserModelId is set. |
kioskAppUserModelId |
String |
Specifies the application user model ID of the app to use with assigned access. |
maintenanceStartTime |
TimeOfDay |
Specifies the daily start time of maintenance hour. |
Response
If successful, this method returns a 200 OK
response code and an updated sharedPCConfiguration object in the response body.
Example
Request
Here is an example of the request.
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);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
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"\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// 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)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// 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);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
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);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?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();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
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
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# 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)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
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.
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1032
{
"@odata.type": "#microsoft.graph.sharedPCConfiguration",
"id": "5206be3b-be3b-5206-3bbe-06523bbe0652",
"lastModifiedDateTime": "2017-01-01T00:00:35.1329464-08:00",
"createdDateTime": "2017-01-01T00:02:43.5775965-08:00",
"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"
}