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 201 Created response code and a sharedPCConfiguration object in the response body.
// 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.PostAsync(requestBody);
// 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().post(deviceConfiguration);
<?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()->post($requestBody)->wait();
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.