One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Here is an example of the request.
PATCH https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations/{deviceConfigurationId}
Content-type: application/json
Content-length: 1831
{
"@odata.type": "#microsoft.graph.androidWorkProfileGeneralDeviceConfiguration",
"description": "Description value",
"displayName": "Display Name value",
"version": 7,
"passwordBlockFingerprintUnlock": true,
"passwordBlockTrustAgents": true,
"passwordExpirationDays": 6,
"passwordMinimumLength": 5,
"passwordMinutesOfInactivityBeforeScreenTimeout": 14,
"passwordPreviousPasswordBlockCount": 2,
"passwordSignInFailureCountBeforeFactoryReset": 12,
"passwordRequiredType": "lowSecurityBiometric",
"workProfileDataSharingType": "preventAny",
"workProfileBlockNotificationsWhileDeviceLocked": true,
"workProfileBlockAddingAccounts": true,
"workProfileBluetoothEnableContactSharing": true,
"workProfileBlockScreenCapture": true,
"workProfileBlockCrossProfileCallerId": true,
"workProfileBlockCamera": true,
"workProfileBlockCrossProfileContactsSearch": true,
"workProfileBlockCrossProfileCopyPaste": true,
"workProfileDefaultAppPermissionPolicy": "prompt",
"workProfilePasswordBlockFingerprintUnlock": true,
"workProfilePasswordBlockTrustAgents": true,
"workProfilePasswordExpirationDays": 1,
"workProfilePasswordMinimumLength": 0,
"workProfilePasswordMinNumericCharacters": 7,
"workProfilePasswordMinNonLetterCharacters": 9,
"workProfilePasswordMinLetterCharacters": 6,
"workProfilePasswordMinLowerCaseCharacters": 9,
"workProfilePasswordMinUpperCaseCharacters": 9,
"workProfilePasswordMinSymbolCharacters": 6,
"workProfilePasswordMinutesOfInactivityBeforeScreenTimeout": 9,
"workProfilePasswordPreviousPasswordBlockCount": 13,
"workProfilePasswordSignInFailureCountBeforeFactoryReset": 7,
"workProfilePasswordRequiredType": "lowSecurityBiometric",
"workProfileRequirePassword": true,
"securityRequireVerifyApps": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new AndroidWorkProfileGeneralDeviceConfiguration
{
OdataType = "#microsoft.graph.androidWorkProfileGeneralDeviceConfiguration",
Description = "Description value",
DisplayName = "Display Name value",
Version = 7,
PasswordBlockFingerprintUnlock = true,
PasswordBlockTrustAgents = true,
PasswordExpirationDays = 6,
PasswordMinimumLength = 5,
PasswordMinutesOfInactivityBeforeScreenTimeout = 14,
PasswordPreviousPasswordBlockCount = 2,
PasswordSignInFailureCountBeforeFactoryReset = 12,
PasswordRequiredType = AndroidWorkProfileRequiredPasswordType.LowSecurityBiometric,
WorkProfileDataSharingType = AndroidWorkProfileCrossProfileDataSharingType.PreventAny,
WorkProfileBlockNotificationsWhileDeviceLocked = true,
WorkProfileBlockAddingAccounts = true,
WorkProfileBluetoothEnableContactSharing = true,
WorkProfileBlockScreenCapture = true,
WorkProfileBlockCrossProfileCallerId = true,
WorkProfileBlockCamera = true,
WorkProfileBlockCrossProfileContactsSearch = true,
WorkProfileBlockCrossProfileCopyPaste = true,
WorkProfileDefaultAppPermissionPolicy = AndroidWorkProfileDefaultAppPermissionPolicyType.Prompt,
WorkProfilePasswordBlockFingerprintUnlock = true,
WorkProfilePasswordBlockTrustAgents = true,
WorkProfilePasswordExpirationDays = 1,
WorkProfilePasswordMinimumLength = 0,
WorkProfilePasswordMinNumericCharacters = 7,
WorkProfilePasswordMinNonLetterCharacters = 9,
WorkProfilePasswordMinLetterCharacters = 6,
WorkProfilePasswordMinLowerCaseCharacters = 9,
WorkProfilePasswordMinUpperCaseCharacters = 9,
WorkProfilePasswordMinSymbolCharacters = 6,
WorkProfilePasswordMinutesOfInactivityBeforeScreenTimeout = 9,
WorkProfilePasswordPreviousPasswordBlockCount = 13,
WorkProfilePasswordSignInFailureCountBeforeFactoryReset = 7,
WorkProfilePasswordRequiredType = AndroidWorkProfileRequiredPasswordType.LowSecurityBiometric,
WorkProfileRequirePassword = true,
SecurityRequireVerifyApps = true,
};
// 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.androidWorkProfileGeneralDeviceConfiguration",\
"description": "Description value",\
"displayName": "Display Name value",\
"version": 7,\
"passwordBlockFingerprintUnlock": true,\
"passwordBlockTrustAgents": true,\
"passwordExpirationDays": 6,\
"passwordMinimumLength": 5,\
"passwordMinutesOfInactivityBeforeScreenTimeout": 14,\
"passwordPreviousPasswordBlockCount": 2,\
"passwordSignInFailureCountBeforeFactoryReset": 12,\
"passwordRequiredType": "lowSecurityBiometric",\
"workProfileDataSharingType": "preventAny",\
"workProfileBlockNotificationsWhileDeviceLocked": true,\
"workProfileBlockAddingAccounts": true,\
"workProfileBluetoothEnableContactSharing": true,\
"workProfileBlockScreenCapture": true,\
"workProfileBlockCrossProfileCallerId": true,\
"workProfileBlockCamera": true,\
"workProfileBlockCrossProfileContactsSearch": true,\
"workProfileBlockCrossProfileCopyPaste": true,\
"workProfileDefaultAppPermissionPolicy": "prompt",\
"workProfilePasswordBlockFingerprintUnlock": true,\
"workProfilePasswordBlockTrustAgents": true,\
"workProfilePasswordExpirationDays": 1,\
"workProfilePasswordMinimumLength": 0,\
"workProfilePasswordMinNumericCharacters": 7,\
"workProfilePasswordMinNonLetterCharacters": 9,\
"workProfilePasswordMinLetterCharacters": 6,\
"workProfilePasswordMinLowerCaseCharacters": 9,\
"workProfilePasswordMinUpperCaseCharacters": 9,\
"workProfilePasswordMinSymbolCharacters": 6,\
"workProfilePasswordMinutesOfInactivityBeforeScreenTimeout": 9,\
"workProfilePasswordPreviousPasswordBlockCount": 13,\
"workProfilePasswordSignInFailureCountBeforeFactoryReset": 7,\
"workProfilePasswordRequiredType": "lowSecurityBiometric",\
"workProfileRequirePassword": true,\
"securityRequireVerifyApps": true\
}\
'
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)
passwordBlockFingerprintUnlock := true
requestBody.SetPasswordBlockFingerprintUnlock(&passwordBlockFingerprintUnlock)
passwordBlockTrustAgents := true
requestBody.SetPasswordBlockTrustAgents(&passwordBlockTrustAgents)
passwordExpirationDays := int32(6)
requestBody.SetPasswordExpirationDays(&passwordExpirationDays)
passwordMinimumLength := int32(5)
requestBody.SetPasswordMinimumLength(&passwordMinimumLength)
passwordMinutesOfInactivityBeforeScreenTimeout := int32(14)
requestBody.SetPasswordMinutesOfInactivityBeforeScreenTimeout(&passwordMinutesOfInactivityBeforeScreenTimeout)
passwordPreviousPasswordBlockCount := int32(2)
requestBody.SetPasswordPreviousPasswordBlockCount(&passwordPreviousPasswordBlockCount)
passwordSignInFailureCountBeforeFactoryReset := int32(12)
requestBody.SetPasswordSignInFailureCountBeforeFactoryReset(&passwordSignInFailureCountBeforeFactoryReset)
passwordRequiredType := graphmodels.LOWSECURITYBIOMETRIC_ANDROIDWORKPROFILEREQUIREDPASSWORDTYPE
requestBody.SetPasswordRequiredType(&passwordRequiredType)
workProfileDataSharingType := graphmodels.PREVENTANY_ANDROIDWORKPROFILECROSSPROFILEDATASHARINGTYPE
requestBody.SetWorkProfileDataSharingType(&workProfileDataSharingType)
workProfileBlockNotificationsWhileDeviceLocked := true
requestBody.SetWorkProfileBlockNotificationsWhileDeviceLocked(&workProfileBlockNotificationsWhileDeviceLocked)
workProfileBlockAddingAccounts := true
requestBody.SetWorkProfileBlockAddingAccounts(&workProfileBlockAddingAccounts)
workProfileBluetoothEnableContactSharing := true
requestBody.SetWorkProfileBluetoothEnableContactSharing(&workProfileBluetoothEnableContactSharing)
workProfileBlockScreenCapture := true
requestBody.SetWorkProfileBlockScreenCapture(&workProfileBlockScreenCapture)
workProfileBlockCrossProfileCallerId := true
requestBody.SetWorkProfileBlockCrossProfileCallerId(&workProfileBlockCrossProfileCallerId)
workProfileBlockCamera := true
requestBody.SetWorkProfileBlockCamera(&workProfileBlockCamera)
workProfileBlockCrossProfileContactsSearch := true
requestBody.SetWorkProfileBlockCrossProfileContactsSearch(&workProfileBlockCrossProfileContactsSearch)
workProfileBlockCrossProfileCopyPaste := true
requestBody.SetWorkProfileBlockCrossProfileCopyPaste(&workProfileBlockCrossProfileCopyPaste)
workProfileDefaultAppPermissionPolicy := graphmodels.PROMPT_ANDROIDWORKPROFILEDEFAULTAPPPERMISSIONPOLICYTYPE
requestBody.SetWorkProfileDefaultAppPermissionPolicy(&workProfileDefaultAppPermissionPolicy)
workProfilePasswordBlockFingerprintUnlock := true
requestBody.SetWorkProfilePasswordBlockFingerprintUnlock(&workProfilePasswordBlockFingerprintUnlock)
workProfilePasswordBlockTrustAgents := true
requestBody.SetWorkProfilePasswordBlockTrustAgents(&workProfilePasswordBlockTrustAgents)
workProfilePasswordExpirationDays := int32(1)
requestBody.SetWorkProfilePasswordExpirationDays(&workProfilePasswordExpirationDays)
workProfilePasswordMinimumLength := int32(0)
requestBody.SetWorkProfilePasswordMinimumLength(&workProfilePasswordMinimumLength)
workProfilePasswordMinNumericCharacters := int32(7)
requestBody.SetWorkProfilePasswordMinNumericCharacters(&workProfilePasswordMinNumericCharacters)
workProfilePasswordMinNonLetterCharacters := int32(9)
requestBody.SetWorkProfilePasswordMinNonLetterCharacters(&workProfilePasswordMinNonLetterCharacters)
workProfilePasswordMinLetterCharacters := int32(6)
requestBody.SetWorkProfilePasswordMinLetterCharacters(&workProfilePasswordMinLetterCharacters)
workProfilePasswordMinLowerCaseCharacters := int32(9)
requestBody.SetWorkProfilePasswordMinLowerCaseCharacters(&workProfilePasswordMinLowerCaseCharacters)
workProfilePasswordMinUpperCaseCharacters := int32(9)
requestBody.SetWorkProfilePasswordMinUpperCaseCharacters(&workProfilePasswordMinUpperCaseCharacters)
workProfilePasswordMinSymbolCharacters := int32(6)
requestBody.SetWorkProfilePasswordMinSymbolCharacters(&workProfilePasswordMinSymbolCharacters)
workProfilePasswordMinutesOfInactivityBeforeScreenTimeout := int32(9)
requestBody.SetWorkProfilePasswordMinutesOfInactivityBeforeScreenTimeout(&workProfilePasswordMinutesOfInactivityBeforeScreenTimeout)
workProfilePasswordPreviousPasswordBlockCount := int32(13)
requestBody.SetWorkProfilePasswordPreviousPasswordBlockCount(&workProfilePasswordPreviousPasswordBlockCount)
workProfilePasswordSignInFailureCountBeforeFactoryReset := int32(7)
requestBody.SetWorkProfilePasswordSignInFailureCountBeforeFactoryReset(&workProfilePasswordSignInFailureCountBeforeFactoryReset)
workProfilePasswordRequiredType := graphmodels.LOWSECURITYBIOMETRIC_ANDROIDWORKPROFILEREQUIREDPASSWORDTYPE
requestBody.SetWorkProfilePasswordRequiredType(&workProfilePasswordRequiredType)
workProfileRequirePassword := true
requestBody.SetWorkProfileRequirePassword(&workProfileRequirePassword)
securityRequireVerifyApps := true
requestBody.SetSecurityRequireVerifyApps(&securityRequireVerifyApps)
// 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);
AndroidWorkProfileGeneralDeviceConfiguration deviceConfiguration = new AndroidWorkProfileGeneralDeviceConfiguration();
deviceConfiguration.setOdataType("#microsoft.graph.androidWorkProfileGeneralDeviceConfiguration");
deviceConfiguration.setDescription("Description value");
deviceConfiguration.setDisplayName("Display Name value");
deviceConfiguration.setVersion(7);
deviceConfiguration.setPasswordBlockFingerprintUnlock(true);
deviceConfiguration.setPasswordBlockTrustAgents(true);
deviceConfiguration.setPasswordExpirationDays(6);
deviceConfiguration.setPasswordMinimumLength(5);
deviceConfiguration.setPasswordMinutesOfInactivityBeforeScreenTimeout(14);
deviceConfiguration.setPasswordPreviousPasswordBlockCount(2);
deviceConfiguration.setPasswordSignInFailureCountBeforeFactoryReset(12);
deviceConfiguration.setPasswordRequiredType(AndroidWorkProfileRequiredPasswordType.LowSecurityBiometric);
deviceConfiguration.setWorkProfileDataSharingType(AndroidWorkProfileCrossProfileDataSharingType.PreventAny);
deviceConfiguration.setWorkProfileBlockNotificationsWhileDeviceLocked(true);
deviceConfiguration.setWorkProfileBlockAddingAccounts(true);
deviceConfiguration.setWorkProfileBluetoothEnableContactSharing(true);
deviceConfiguration.setWorkProfileBlockScreenCapture(true);
deviceConfiguration.setWorkProfileBlockCrossProfileCallerId(true);
deviceConfiguration.setWorkProfileBlockCamera(true);
deviceConfiguration.setWorkProfileBlockCrossProfileContactsSearch(true);
deviceConfiguration.setWorkProfileBlockCrossProfileCopyPaste(true);
deviceConfiguration.setWorkProfileDefaultAppPermissionPolicy(AndroidWorkProfileDefaultAppPermissionPolicyType.Prompt);
deviceConfiguration.setWorkProfilePasswordBlockFingerprintUnlock(true);
deviceConfiguration.setWorkProfilePasswordBlockTrustAgents(true);
deviceConfiguration.setWorkProfilePasswordExpirationDays(1);
deviceConfiguration.setWorkProfilePasswordMinimumLength(0);
deviceConfiguration.setWorkProfilePasswordMinNumericCharacters(7);
deviceConfiguration.setWorkProfilePasswordMinNonLetterCharacters(9);
deviceConfiguration.setWorkProfilePasswordMinLetterCharacters(6);
deviceConfiguration.setWorkProfilePasswordMinLowerCaseCharacters(9);
deviceConfiguration.setWorkProfilePasswordMinUpperCaseCharacters(9);
deviceConfiguration.setWorkProfilePasswordMinSymbolCharacters(6);
deviceConfiguration.setWorkProfilePasswordMinutesOfInactivityBeforeScreenTimeout(9);
deviceConfiguration.setWorkProfilePasswordPreviousPasswordBlockCount(13);
deviceConfiguration.setWorkProfilePasswordSignInFailureCountBeforeFactoryReset(7);
deviceConfiguration.setWorkProfilePasswordRequiredType(AndroidWorkProfileRequiredPasswordType.LowSecurityBiometric);
deviceConfiguration.setWorkProfileRequirePassword(true);
deviceConfiguration.setSecurityRequireVerifyApps(true);
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.androidWorkProfileGeneralDeviceConfiguration',
description: 'Description value',
displayName: 'Display Name value',
version: 7,
passwordBlockFingerprintUnlock: true,
passwordBlockTrustAgents: true,
passwordExpirationDays: 6,
passwordMinimumLength: 5,
passwordMinutesOfInactivityBeforeScreenTimeout: 14,
passwordPreviousPasswordBlockCount: 2,
passwordSignInFailureCountBeforeFactoryReset: 12,
passwordRequiredType: 'lowSecurityBiometric',
workProfileDataSharingType: 'preventAny',
workProfileBlockNotificationsWhileDeviceLocked: true,
workProfileBlockAddingAccounts: true,
workProfileBluetoothEnableContactSharing: true,
workProfileBlockScreenCapture: true,
workProfileBlockCrossProfileCallerId: true,
workProfileBlockCamera: true,
workProfileBlockCrossProfileContactsSearch: true,
workProfileBlockCrossProfileCopyPaste: true,
workProfileDefaultAppPermissionPolicy: 'prompt',
workProfilePasswordBlockFingerprintUnlock: true,
workProfilePasswordBlockTrustAgents: true,
workProfilePasswordExpirationDays: 1,
workProfilePasswordMinimumLength: 0,
workProfilePasswordMinNumericCharacters: 7,
workProfilePasswordMinNonLetterCharacters: 9,
workProfilePasswordMinLetterCharacters: 6,
workProfilePasswordMinLowerCaseCharacters: 9,
workProfilePasswordMinUpperCaseCharacters: 9,
workProfilePasswordMinSymbolCharacters: 6,
workProfilePasswordMinutesOfInactivityBeforeScreenTimeout: 9,
workProfilePasswordPreviousPasswordBlockCount: 13,
workProfilePasswordSignInFailureCountBeforeFactoryReset: 7,
workProfilePasswordRequiredType: 'lowSecurityBiometric',
workProfileRequirePassword: true,
securityRequireVerifyApps: true
};
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\AndroidWorkProfileGeneralDeviceConfiguration;
use Microsoft\Graph\Generated\Models\AndroidWorkProfileRequiredPasswordType;
use Microsoft\Graph\Generated\Models\AndroidWorkProfileCrossProfileDataSharingType;
use Microsoft\Graph\Generated\Models\AndroidWorkProfileDefaultAppPermissionPolicyType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AndroidWorkProfileGeneralDeviceConfiguration();
$requestBody->setOdataType('#microsoft.graph.androidWorkProfileGeneralDeviceConfiguration');
$requestBody->setDescription('Description value');
$requestBody->setDisplayName('Display Name value');
$requestBody->setVersion(7);
$requestBody->setPasswordBlockFingerprintUnlock(true);
$requestBody->setPasswordBlockTrustAgents(true);
$requestBody->setPasswordExpirationDays(6);
$requestBody->setPasswordMinimumLength(5);
$requestBody->setPasswordMinutesOfInactivityBeforeScreenTimeout(14);
$requestBody->setPasswordPreviousPasswordBlockCount(2);
$requestBody->setPasswordSignInFailureCountBeforeFactoryReset(12);
$requestBody->setPasswordRequiredType(new AndroidWorkProfileRequiredPasswordType('lowSecurityBiometric'));
$requestBody->setWorkProfileDataSharingType(new AndroidWorkProfileCrossProfileDataSharingType('preventAny'));
$requestBody->setWorkProfileBlockNotificationsWhileDeviceLocked(true);
$requestBody->setWorkProfileBlockAddingAccounts(true);
$requestBody->setWorkProfileBluetoothEnableContactSharing(true);
$requestBody->setWorkProfileBlockScreenCapture(true);
$requestBody->setWorkProfileBlockCrossProfileCallerId(true);
$requestBody->setWorkProfileBlockCamera(true);
$requestBody->setWorkProfileBlockCrossProfileContactsSearch(true);
$requestBody->setWorkProfileBlockCrossProfileCopyPaste(true);
$requestBody->setWorkProfileDefaultAppPermissionPolicy(new AndroidWorkProfileDefaultAppPermissionPolicyType('prompt'));
$requestBody->setWorkProfilePasswordBlockFingerprintUnlock(true);
$requestBody->setWorkProfilePasswordBlockTrustAgents(true);
$requestBody->setWorkProfilePasswordExpirationDays(1);
$requestBody->setWorkProfilePasswordMinimumLength(0);
$requestBody->setWorkProfilePasswordMinNumericCharacters(7);
$requestBody->setWorkProfilePasswordMinNonLetterCharacters(9);
$requestBody->setWorkProfilePasswordMinLetterCharacters(6);
$requestBody->setWorkProfilePasswordMinLowerCaseCharacters(9);
$requestBody->setWorkProfilePasswordMinUpperCaseCharacters(9);
$requestBody->setWorkProfilePasswordMinSymbolCharacters(6);
$requestBody->setWorkProfilePasswordMinutesOfInactivityBeforeScreenTimeout(9);
$requestBody->setWorkProfilePasswordPreviousPasswordBlockCount(13);
$requestBody->setWorkProfilePasswordSignInFailureCountBeforeFactoryReset(7);
$requestBody->setWorkProfilePasswordRequiredType(new AndroidWorkProfileRequiredPasswordType('lowSecurityBiometric'));
$requestBody->setWorkProfileRequirePassword(true);
$requestBody->setSecurityRequireVerifyApps(true);
$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.androidWorkProfileGeneralDeviceConfiguration"
description = "Description value"
displayName = "Display Name value"
version = 7
passwordBlockFingerprintUnlock = $true
passwordBlockTrustAgents = $true
passwordExpirationDays =
passwordMinimumLength =
passwordMinutesOfInactivityBeforeScreenTimeout =
passwordPreviousPasswordBlockCount =
passwordSignInFailureCountBeforeFactoryReset =
passwordRequiredType = "lowSecurityBiometric"
workProfileDataSharingType = "preventAny"
workProfileBlockNotificationsWhileDeviceLocked = $true
workProfileBlockAddingAccounts = $true
workProfileBluetoothEnableContactSharing = $true
workProfileBlockScreenCapture = $true
workProfileBlockCrossProfileCallerId = $true
workProfileBlockCamera = $true
workProfileBlockCrossProfileContactsSearch = $true
workProfileBlockCrossProfileCopyPaste = $true
workProfileDefaultAppPermissionPolicy = "prompt"
workProfilePasswordBlockFingerprintUnlock = $true
workProfilePasswordBlockTrustAgents = $true
workProfilePasswordExpirationDays =
workProfilePasswordMinimumLength =
workProfilePasswordMinNumericCharacters =
workProfilePasswordMinNonLetterCharacters =
workProfilePasswordMinLetterCharacters =
workProfilePasswordMinLowerCaseCharacters =
workProfilePasswordMinUpperCaseCharacters =
workProfilePasswordMinSymbolCharacters =
workProfilePasswordMinutesOfInactivityBeforeScreenTimeout =
workProfilePasswordPreviousPasswordBlockCount =
workProfilePasswordSignInFailureCountBeforeFactoryReset =
workProfilePasswordRequiredType = "lowSecurityBiometric"
workProfileRequirePassword = $true
securityRequireVerifyApps = $true
}
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.android_work_profile_general_device_configuration import AndroidWorkProfileGeneralDeviceConfiguration
from msgraph.generated.models.android_work_profile_required_password_type import AndroidWorkProfileRequiredPasswordType
from msgraph.generated.models.android_work_profile_cross_profile_data_sharing_type import AndroidWorkProfileCrossProfileDataSharingType
from msgraph.generated.models.android_work_profile_default_app_permission_policy_type import AndroidWorkProfileDefaultAppPermissionPolicyType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AndroidWorkProfileGeneralDeviceConfiguration(
odata_type = "#microsoft.graph.androidWorkProfileGeneralDeviceConfiguration",
description = "Description value",
display_name = "Display Name value",
version = 7,
password_block_fingerprint_unlock = True,
password_block_trust_agents = True,
password_expiration_days = 6,
password_minimum_length = 5,
password_minutes_of_inactivity_before_screen_timeout = 14,
password_previous_password_block_count = 2,
password_sign_in_failure_count_before_factory_reset = 12,
password_required_type = AndroidWorkProfileRequiredPasswordType.LowSecurityBiometric,
work_profile_data_sharing_type = AndroidWorkProfileCrossProfileDataSharingType.PreventAny,
work_profile_block_notifications_while_device_locked = True,
work_profile_block_adding_accounts = True,
work_profile_bluetooth_enable_contact_sharing = True,
work_profile_block_screen_capture = True,
work_profile_block_cross_profile_caller_id = True,
work_profile_block_camera = True,
work_profile_block_cross_profile_contacts_search = True,
work_profile_block_cross_profile_copy_paste = True,
work_profile_default_app_permission_policy = AndroidWorkProfileDefaultAppPermissionPolicyType.Prompt,
work_profile_password_block_fingerprint_unlock = True,
work_profile_password_block_trust_agents = True,
work_profile_password_expiration_days = 1,
work_profile_password_minimum_length = 0,
work_profile_password_min_numeric_characters = 7,
work_profile_password_min_non_letter_characters = 9,
work_profile_password_min_letter_characters = 6,
work_profile_password_min_lower_case_characters = 9,
work_profile_password_min_upper_case_characters = 9,
work_profile_password_min_symbol_characters = 6,
work_profile_password_minutes_of_inactivity_before_screen_timeout = 9,
work_profile_password_previous_password_block_count = 13,
work_profile_password_sign_in_failure_count_before_factory_reset = 7,
work_profile_password_required_type = AndroidWorkProfileRequiredPasswordType.LowSecurityBiometric,
work_profile_require_password = True,
security_require_verify_apps = True,
)
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.
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.