One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
In the request body, supply a JSON representation for the androidGeneralDeviceConfiguration object.
The following table shows the properties that are required when you create the androidGeneralDeviceConfiguration.
Here is an example of the request.
POST https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations
Content-type: application/json
Content-length: 3033
{
"@odata.type": "#microsoft.graph.androidGeneralDeviceConfiguration",
"description": "Description value",
"displayName": "Display Name value",
"version": 7,
"appsBlockClipboardSharing": true,
"appsBlockCopyPaste": true,
"appsBlockYouTube": true,
"bluetoothBlocked": true,
"cameraBlocked": true,
"cellularBlockDataRoaming": true,
"cellularBlockMessaging": true,
"cellularBlockVoiceRoaming": true,
"cellularBlockWiFiTethering": true,
"compliantAppsList": [
{
"@odata.type": "microsoft.graph.appListItem",
"name": "Name value",
"publisher": "Publisher value",
"appStoreUrl": "https://example.com/appStoreUrl/",
"appId": "App Id value"
}
],
"compliantAppListType": "appsInListCompliant",
"diagnosticDataBlockSubmission": true,
"locationServicesBlocked": true,
"googleAccountBlockAutoSync": true,
"googlePlayStoreBlocked": true,
"kioskModeBlockSleepButton": true,
"kioskModeBlockVolumeButtons": true,
"kioskModeApps": [
{
"@odata.type": "microsoft.graph.appListItem",
"name": "Name value",
"publisher": "Publisher value",
"appStoreUrl": "https://example.com/appStoreUrl/",
"appId": "App Id value"
}
],
"nfcBlocked": true,
"passwordBlockFingerprintUnlock": true,
"passwordBlockTrustAgents": true,
"passwordExpirationDays": 6,
"passwordMinimumLength": 5,
"passwordMinutesOfInactivityBeforeScreenTimeout": 14,
"passwordPreviousPasswordBlockCount": 2,
"passwordSignInFailureCountBeforeFactoryReset": 12,
"passwordRequiredType": "alphabetic",
"passwordRequired": true,
"powerOffBlocked": true,
"factoryResetBlocked": true,
"screenCaptureBlocked": true,
"deviceSharingAllowed": true,
"storageBlockGoogleBackup": true,
"storageBlockRemovableStorage": true,
"storageRequireDeviceEncryption": true,
"storageRequireRemovableStorageEncryption": true,
"voiceAssistantBlocked": true,
"voiceDialingBlocked": true,
"webBrowserBlockPopups": true,
"webBrowserBlockAutofill": true,
"webBrowserBlockJavaScript": true,
"webBrowserBlocked": true,
"webBrowserCookieSettings": "blockAlways",
"wiFiBlocked": true,
"appsInstallAllowList": [
{
"@odata.type": "microsoft.graph.appListItem",
"name": "Name value",
"publisher": "Publisher value",
"appStoreUrl": "https://example.com/appStoreUrl/",
"appId": "App Id value"
}
],
"appsLaunchBlockList": [
{
"@odata.type": "microsoft.graph.appListItem",
"name": "Name value",
"publisher": "Publisher value",
"appStoreUrl": "https://example.com/appStoreUrl/",
"appId": "App Id value"
}
],
"appsHideList": [
{
"@odata.type": "microsoft.graph.appListItem",
"name": "Name value",
"publisher": "Publisher value",
"appStoreUrl": "https://example.com/appStoreUrl/",
"appId": "App Id value"
}
],
"securityRequireVerifyApps": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new AndroidGeneralDeviceConfiguration
{
OdataType = "#microsoft.graph.androidGeneralDeviceConfiguration",
Description = "Description value",
DisplayName = "Display Name value",
Version = 7,
AppsBlockClipboardSharing = true,
AppsBlockCopyPaste = true,
AppsBlockYouTube = true,
BluetoothBlocked = true,
CameraBlocked = true,
CellularBlockDataRoaming = true,
CellularBlockMessaging = true,
CellularBlockVoiceRoaming = true,
CellularBlockWiFiTethering = true,
CompliantAppsList = new List<AppListItem>
{
new AppListItem
{
OdataType = "microsoft.graph.appListItem",
Name = "Name value",
Publisher = "Publisher value",
AppStoreUrl = "https://example.com/appStoreUrl/",
AppId = "App Id value",
},
},
CompliantAppListType = AppListType.AppsInListCompliant,
DiagnosticDataBlockSubmission = true,
LocationServicesBlocked = true,
GoogleAccountBlockAutoSync = true,
GooglePlayStoreBlocked = true,
KioskModeBlockSleepButton = true,
KioskModeBlockVolumeButtons = true,
KioskModeApps = new List<AppListItem>
{
new AppListItem
{
OdataType = "microsoft.graph.appListItem",
Name = "Name value",
Publisher = "Publisher value",
AppStoreUrl = "https://example.com/appStoreUrl/",
AppId = "App Id value",
},
},
NfcBlocked = true,
PasswordBlockFingerprintUnlock = true,
PasswordBlockTrustAgents = true,
PasswordExpirationDays = 6,
PasswordMinimumLength = 5,
PasswordMinutesOfInactivityBeforeScreenTimeout = 14,
PasswordPreviousPasswordBlockCount = 2,
PasswordSignInFailureCountBeforeFactoryReset = 12,
PasswordRequiredType = AndroidRequiredPasswordType.Alphabetic,
PasswordRequired = true,
PowerOffBlocked = true,
FactoryResetBlocked = true,
ScreenCaptureBlocked = true,
DeviceSharingAllowed = true,
StorageBlockGoogleBackup = true,
StorageBlockRemovableStorage = true,
StorageRequireDeviceEncryption = true,
StorageRequireRemovableStorageEncryption = true,
VoiceAssistantBlocked = true,
VoiceDialingBlocked = true,
WebBrowserBlockPopups = true,
WebBrowserBlockAutofill = true,
WebBrowserBlockJavaScript = true,
WebBrowserBlocked = true,
WebBrowserCookieSettings = WebBrowserCookieSettings.BlockAlways,
WiFiBlocked = true,
AppsInstallAllowList = new List<AppListItem>
{
new AppListItem
{
OdataType = "microsoft.graph.appListItem",
Name = "Name value",
Publisher = "Publisher value",
AppStoreUrl = "https://example.com/appStoreUrl/",
AppId = "App Id value",
},
},
AppsLaunchBlockList = new List<AppListItem>
{
new AppListItem
{
OdataType = "microsoft.graph.appListItem",
Name = "Name value",
Publisher = "Publisher value",
AppStoreUrl = "https://example.com/appStoreUrl/",
AppId = "App Id value",
},
},
AppsHideList = new List<AppListItem>
{
new AppListItem
{
OdataType = "microsoft.graph.appListItem",
Name = "Name value",
Publisher = "Publisher value",
AppStoreUrl = "https://example.com/appStoreUrl/",
AppId = "App Id value",
},
},
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.PostAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc device-management device-configurations create --body '{\
"@odata.type": "#microsoft.graph.androidGeneralDeviceConfiguration",\
"description": "Description value",\
"displayName": "Display Name value",\
"version": 7,\
"appsBlockClipboardSharing": true,\
"appsBlockCopyPaste": true,\
"appsBlockYouTube": true,\
"bluetoothBlocked": true,\
"cameraBlocked": true,\
"cellularBlockDataRoaming": true,\
"cellularBlockMessaging": true,\
"cellularBlockVoiceRoaming": true,\
"cellularBlockWiFiTethering": true,\
"compliantAppsList": [\
{\
"@odata.type": "microsoft.graph.appListItem",\
"name": "Name value",\
"publisher": "Publisher value",\
"appStoreUrl": "https://example.com/appStoreUrl/",\
"appId": "App Id value"\
}\
],\
"compliantAppListType": "appsInListCompliant",\
"diagnosticDataBlockSubmission": true,\
"locationServicesBlocked": true,\
"googleAccountBlockAutoSync": true,\
"googlePlayStoreBlocked": true,\
"kioskModeBlockSleepButton": true,\
"kioskModeBlockVolumeButtons": true,\
"kioskModeApps": [\
{\
"@odata.type": "microsoft.graph.appListItem",\
"name": "Name value",\
"publisher": "Publisher value",\
"appStoreUrl": "https://example.com/appStoreUrl/",\
"appId": "App Id value"\
}\
],\
"nfcBlocked": true,\
"passwordBlockFingerprintUnlock": true,\
"passwordBlockTrustAgents": true,\
"passwordExpirationDays": 6,\
"passwordMinimumLength": 5,\
"passwordMinutesOfInactivityBeforeScreenTimeout": 14,\
"passwordPreviousPasswordBlockCount": 2,\
"passwordSignInFailureCountBeforeFactoryReset": 12,\
"passwordRequiredType": "alphabetic",\
"passwordRequired": true,\
"powerOffBlocked": true,\
"factoryResetBlocked": true,\
"screenCaptureBlocked": true,\
"deviceSharingAllowed": true,\
"storageBlockGoogleBackup": true,\
"storageBlockRemovableStorage": true,\
"storageRequireDeviceEncryption": true,\
"storageRequireRemovableStorageEncryption": true,\
"voiceAssistantBlocked": true,\
"voiceDialingBlocked": true,\
"webBrowserBlockPopups": true,\
"webBrowserBlockAutofill": true,\
"webBrowserBlockJavaScript": true,\
"webBrowserBlocked": true,\
"webBrowserCookieSettings": "blockAlways",\
"wiFiBlocked": true,\
"appsInstallAllowList": [\
{\
"@odata.type": "microsoft.graph.appListItem",\
"name": "Name value",\
"publisher": "Publisher value",\
"appStoreUrl": "https://example.com/appStoreUrl/",\
"appId": "App Id value"\
}\
],\
"appsLaunchBlockList": [\
{\
"@odata.type": "microsoft.graph.appListItem",\
"name": "Name value",\
"publisher": "Publisher value",\
"appStoreUrl": "https://example.com/appStoreUrl/",\
"appId": "App Id value"\
}\
],\
"appsHideList": [\
{\
"@odata.type": "microsoft.graph.appListItem",\
"name": "Name value",\
"publisher": "Publisher value",\
"appStoreUrl": "https://example.com/appStoreUrl/",\
"appId": "App Id value"\
}\
],\
"securityRequireVerifyApps": true\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewDeviceConfiguration()
description := "Description value"
requestBody.SetDescription(&description)
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
version := int32(7)
requestBody.SetVersion(&version)
appsBlockClipboardSharing := true
requestBody.SetAppsBlockClipboardSharing(&appsBlockClipboardSharing)
appsBlockCopyPaste := true
requestBody.SetAppsBlockCopyPaste(&appsBlockCopyPaste)
appsBlockYouTube := true
requestBody.SetAppsBlockYouTube(&appsBlockYouTube)
bluetoothBlocked := true
requestBody.SetBluetoothBlocked(&bluetoothBlocked)
cameraBlocked := true
requestBody.SetCameraBlocked(&cameraBlocked)
cellularBlockDataRoaming := true
requestBody.SetCellularBlockDataRoaming(&cellularBlockDataRoaming)
cellularBlockMessaging := true
requestBody.SetCellularBlockMessaging(&cellularBlockMessaging)
cellularBlockVoiceRoaming := true
requestBody.SetCellularBlockVoiceRoaming(&cellularBlockVoiceRoaming)
cellularBlockWiFiTethering := true
requestBody.SetCellularBlockWiFiTethering(&cellularBlockWiFiTethering)
appListItem := graphmodels.NewAppListItem()
name := "Name value"
appListItem.SetName(&name)
publisher := "Publisher value"
appListItem.SetPublisher(&publisher)
appStoreUrl := "https://example.com/appStoreUrl/"
appListItem.SetAppStoreUrl(&appStoreUrl)
appId := "App Id value"
appListItem.SetAppId(&appId)
compliantAppsList := []graphmodels.AppListItemable {
appListItem,
}
requestBody.SetCompliantAppsList(compliantAppsList)
compliantAppListType := graphmodels.APPSINLISTCOMPLIANT_APPLISTTYPE
requestBody.SetCompliantAppListType(&compliantAppListType)
diagnosticDataBlockSubmission := true
requestBody.SetDiagnosticDataBlockSubmission(&diagnosticDataBlockSubmission)
locationServicesBlocked := true
requestBody.SetLocationServicesBlocked(&locationServicesBlocked)
googleAccountBlockAutoSync := true
requestBody.SetGoogleAccountBlockAutoSync(&googleAccountBlockAutoSync)
googlePlayStoreBlocked := true
requestBody.SetGooglePlayStoreBlocked(&googlePlayStoreBlocked)
kioskModeBlockSleepButton := true
requestBody.SetKioskModeBlockSleepButton(&kioskModeBlockSleepButton)
kioskModeBlockVolumeButtons := true
requestBody.SetKioskModeBlockVolumeButtons(&kioskModeBlockVolumeButtons)
appListItem := graphmodels.NewAppListItem()
name := "Name value"
appListItem.SetName(&name)
publisher := "Publisher value"
appListItem.SetPublisher(&publisher)
appStoreUrl := "https://example.com/appStoreUrl/"
appListItem.SetAppStoreUrl(&appStoreUrl)
appId := "App Id value"
appListItem.SetAppId(&appId)
kioskModeApps := []graphmodels.AppListItemable {
appListItem,
}
requestBody.SetKioskModeApps(kioskModeApps)
nfcBlocked := true
requestBody.SetNfcBlocked(&nfcBlocked)
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.ALPHABETIC_ANDROIDREQUIREDPASSWORDTYPE
requestBody.SetPasswordRequiredType(&passwordRequiredType)
passwordRequired := true
requestBody.SetPasswordRequired(&passwordRequired)
powerOffBlocked := true
requestBody.SetPowerOffBlocked(&powerOffBlocked)
factoryResetBlocked := true
requestBody.SetFactoryResetBlocked(&factoryResetBlocked)
screenCaptureBlocked := true
requestBody.SetScreenCaptureBlocked(&screenCaptureBlocked)
deviceSharingAllowed := true
requestBody.SetDeviceSharingAllowed(&deviceSharingAllowed)
storageBlockGoogleBackup := true
requestBody.SetStorageBlockGoogleBackup(&storageBlockGoogleBackup)
storageBlockRemovableStorage := true
requestBody.SetStorageBlockRemovableStorage(&storageBlockRemovableStorage)
storageRequireDeviceEncryption := true
requestBody.SetStorageRequireDeviceEncryption(&storageRequireDeviceEncryption)
storageRequireRemovableStorageEncryption := true
requestBody.SetStorageRequireRemovableStorageEncryption(&storageRequireRemovableStorageEncryption)
voiceAssistantBlocked := true
requestBody.SetVoiceAssistantBlocked(&voiceAssistantBlocked)
voiceDialingBlocked := true
requestBody.SetVoiceDialingBlocked(&voiceDialingBlocked)
webBrowserBlockPopups := true
requestBody.SetWebBrowserBlockPopups(&webBrowserBlockPopups)
webBrowserBlockAutofill := true
requestBody.SetWebBrowserBlockAutofill(&webBrowserBlockAutofill)
webBrowserBlockJavaScript := true
requestBody.SetWebBrowserBlockJavaScript(&webBrowserBlockJavaScript)
webBrowserBlocked := true
requestBody.SetWebBrowserBlocked(&webBrowserBlocked)
webBrowserCookieSettings := graphmodels.BLOCKALWAYS_WEBBROWSERCOOKIESETTINGS
requestBody.SetWebBrowserCookieSettings(&webBrowserCookieSettings)
wiFiBlocked := true
requestBody.SetWiFiBlocked(&wiFiBlocked)
appListItem := graphmodels.NewAppListItem()
name := "Name value"
appListItem.SetName(&name)
publisher := "Publisher value"
appListItem.SetPublisher(&publisher)
appStoreUrl := "https://example.com/appStoreUrl/"
appListItem.SetAppStoreUrl(&appStoreUrl)
appId := "App Id value"
appListItem.SetAppId(&appId)
appsInstallAllowList := []graphmodels.AppListItemable {
appListItem,
}
requestBody.SetAppsInstallAllowList(appsInstallAllowList)
appListItem := graphmodels.NewAppListItem()
name := "Name value"
appListItem.SetName(&name)
publisher := "Publisher value"
appListItem.SetPublisher(&publisher)
appStoreUrl := "https://example.com/appStoreUrl/"
appListItem.SetAppStoreUrl(&appStoreUrl)
appId := "App Id value"
appListItem.SetAppId(&appId)
appsLaunchBlockList := []graphmodels.AppListItemable {
appListItem,
}
requestBody.SetAppsLaunchBlockList(appsLaunchBlockList)
appListItem := graphmodels.NewAppListItem()
name := "Name value"
appListItem.SetName(&name)
publisher := "Publisher value"
appListItem.SetPublisher(&publisher)
appStoreUrl := "https://example.com/appStoreUrl/"
appListItem.SetAppStoreUrl(&appStoreUrl)
appId := "App Id value"
appListItem.SetAppId(&appId)
appsHideList := []graphmodels.AppListItemable {
appListItem,
}
requestBody.SetAppsHideList(appsHideList)
securityRequireVerifyApps := true
requestBody.SetSecurityRequireVerifyApps(&securityRequireVerifyApps)
deviceConfigurations, err := graphClient.DeviceManagement().DeviceConfigurations().Post(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
AndroidGeneralDeviceConfiguration deviceConfiguration = new AndroidGeneralDeviceConfiguration();
deviceConfiguration.description = "Description value";
deviceConfiguration.displayName = "Display Name value";
deviceConfiguration.version = 7;
deviceConfiguration.appsBlockClipboardSharing = true;
deviceConfiguration.appsBlockCopyPaste = true;
deviceConfiguration.appsBlockYouTube = true;
deviceConfiguration.bluetoothBlocked = true;
deviceConfiguration.cameraBlocked = true;
deviceConfiguration.cellularBlockDataRoaming = true;
deviceConfiguration.cellularBlockMessaging = true;
deviceConfiguration.cellularBlockVoiceRoaming = true;
deviceConfiguration.cellularBlockWiFiTethering = true;
LinkedList<AppListItem> compliantAppsListList = new LinkedList<AppListItem>();
AppListItem compliantAppsList = new AppListItem();
compliantAppsList.name = "Name value";
compliantAppsList.publisher = "Publisher value";
compliantAppsList.appStoreUrl = "https://example.com/appStoreUrl/";
compliantAppsList.appId = "App Id value";
compliantAppsListList.add(compliantAppsList);
deviceConfiguration.compliantAppsList = compliantAppsListList;
deviceConfiguration.compliantAppListType = AppListType.APPS_IN_LIST_COMPLIANT;
deviceConfiguration.diagnosticDataBlockSubmission = true;
deviceConfiguration.locationServicesBlocked = true;
deviceConfiguration.googleAccountBlockAutoSync = true;
deviceConfiguration.googlePlayStoreBlocked = true;
deviceConfiguration.kioskModeBlockSleepButton = true;
deviceConfiguration.kioskModeBlockVolumeButtons = true;
LinkedList<AppListItem> kioskModeAppsList = new LinkedList<AppListItem>();
AppListItem kioskModeApps = new AppListItem();
kioskModeApps.name = "Name value";
kioskModeApps.publisher = "Publisher value";
kioskModeApps.appStoreUrl = "https://example.com/appStoreUrl/";
kioskModeApps.appId = "App Id value";
kioskModeAppsList.add(kioskModeApps);
deviceConfiguration.kioskModeApps = kioskModeAppsList;
deviceConfiguration.nfcBlocked = true;
deviceConfiguration.passwordBlockFingerprintUnlock = true;
deviceConfiguration.passwordBlockTrustAgents = true;
deviceConfiguration.passwordExpirationDays = 6;
deviceConfiguration.passwordMinimumLength = 5;
deviceConfiguration.passwordMinutesOfInactivityBeforeScreenTimeout = 14;
deviceConfiguration.passwordPreviousPasswordBlockCount = 2;
deviceConfiguration.passwordSignInFailureCountBeforeFactoryReset = 12;
deviceConfiguration.passwordRequiredType = AndroidRequiredPasswordType.ALPHABETIC;
deviceConfiguration.passwordRequired = true;
deviceConfiguration.powerOffBlocked = true;
deviceConfiguration.factoryResetBlocked = true;
deviceConfiguration.screenCaptureBlocked = true;
deviceConfiguration.deviceSharingAllowed = true;
deviceConfiguration.storageBlockGoogleBackup = true;
deviceConfiguration.storageBlockRemovableStorage = true;
deviceConfiguration.storageRequireDeviceEncryption = true;
deviceConfiguration.storageRequireRemovableStorageEncryption = true;
deviceConfiguration.voiceAssistantBlocked = true;
deviceConfiguration.voiceDialingBlocked = true;
deviceConfiguration.webBrowserBlockPopups = true;
deviceConfiguration.webBrowserBlockAutofill = true;
deviceConfiguration.webBrowserBlockJavaScript = true;
deviceConfiguration.webBrowserBlocked = true;
deviceConfiguration.webBrowserCookieSettings = WebBrowserCookieSettings.BLOCK_ALWAYS;
deviceConfiguration.wiFiBlocked = true;
LinkedList<AppListItem> appsInstallAllowListList = new LinkedList<AppListItem>();
AppListItem appsInstallAllowList = new AppListItem();
appsInstallAllowList.name = "Name value";
appsInstallAllowList.publisher = "Publisher value";
appsInstallAllowList.appStoreUrl = "https://example.com/appStoreUrl/";
appsInstallAllowList.appId = "App Id value";
appsInstallAllowListList.add(appsInstallAllowList);
deviceConfiguration.appsInstallAllowList = appsInstallAllowListList;
LinkedList<AppListItem> appsLaunchBlockListList = new LinkedList<AppListItem>();
AppListItem appsLaunchBlockList = new AppListItem();
appsLaunchBlockList.name = "Name value";
appsLaunchBlockList.publisher = "Publisher value";
appsLaunchBlockList.appStoreUrl = "https://example.com/appStoreUrl/";
appsLaunchBlockList.appId = "App Id value";
appsLaunchBlockListList.add(appsLaunchBlockList);
deviceConfiguration.appsLaunchBlockList = appsLaunchBlockListList;
LinkedList<AppListItem> appsHideListList = new LinkedList<AppListItem>();
AppListItem appsHideList = new AppListItem();
appsHideList.name = "Name value";
appsHideList.publisher = "Publisher value";
appsHideList.appStoreUrl = "https://example.com/appStoreUrl/";
appsHideList.appId = "App Id value";
appsHideListList.add(appsHideList);
deviceConfiguration.appsHideList = appsHideListList;
deviceConfiguration.securityRequireVerifyApps = true;
graphClient.deviceManagement().deviceConfigurations()
.buildRequest()
.post(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.androidGeneralDeviceConfiguration',
description: 'Description value',
displayName: 'Display Name value',
version: 7,
appsBlockClipboardSharing: true,
appsBlockCopyPaste: true,
appsBlockYouTube: true,
bluetoothBlocked: true,
cameraBlocked: true,
cellularBlockDataRoaming: true,
cellularBlockMessaging: true,
cellularBlockVoiceRoaming: true,
cellularBlockWiFiTethering: true,
compliantAppsList: [
{
'@odata.type': 'microsoft.graph.appListItem',
name: 'Name value',
publisher: 'Publisher value',
appStoreUrl: 'https://example.com/appStoreUrl/',
appId: 'App Id value'
}
],
compliantAppListType: 'appsInListCompliant',
diagnosticDataBlockSubmission: true,
locationServicesBlocked: true,
googleAccountBlockAutoSync: true,
googlePlayStoreBlocked: true,
kioskModeBlockSleepButton: true,
kioskModeBlockVolumeButtons: true,
kioskModeApps: [
{
'@odata.type': 'microsoft.graph.appListItem',
name: 'Name value',
publisher: 'Publisher value',
appStoreUrl: 'https://example.com/appStoreUrl/',
appId: 'App Id value'
}
],
nfcBlocked: true,
passwordBlockFingerprintUnlock: true,
passwordBlockTrustAgents: true,
passwordExpirationDays: 6,
passwordMinimumLength: 5,
passwordMinutesOfInactivityBeforeScreenTimeout: 14,
passwordPreviousPasswordBlockCount: 2,
passwordSignInFailureCountBeforeFactoryReset: 12,
passwordRequiredType: 'alphabetic',
passwordRequired: true,
powerOffBlocked: true,
factoryResetBlocked: true,
screenCaptureBlocked: true,
deviceSharingAllowed: true,
storageBlockGoogleBackup: true,
storageBlockRemovableStorage: true,
storageRequireDeviceEncryption: true,
storageRequireRemovableStorageEncryption: true,
voiceAssistantBlocked: true,
voiceDialingBlocked: true,
webBrowserBlockPopups: true,
webBrowserBlockAutofill: true,
webBrowserBlockJavaScript: true,
webBrowserBlocked: true,
webBrowserCookieSettings: 'blockAlways',
wiFiBlocked: true,
appsInstallAllowList: [
{
'@odata.type': 'microsoft.graph.appListItem',
name: 'Name value',
publisher: 'Publisher value',
appStoreUrl: 'https://example.com/appStoreUrl/',
appId: 'App Id value'
}
],
appsLaunchBlockList: [
{
'@odata.type': 'microsoft.graph.appListItem',
name: 'Name value',
publisher: 'Publisher value',
appStoreUrl: 'https://example.com/appStoreUrl/',
appId: 'App Id value'
}
],
appsHideList: [
{
'@odata.type': 'microsoft.graph.appListItem',
name: 'Name value',
publisher: 'Publisher value',
appStoreUrl: 'https://example.com/appStoreUrl/',
appId: 'App Id value'
}
],
securityRequireVerifyApps: true
};
await client.api('/deviceManagement/deviceConfigurations')
.post(deviceConfiguration);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AndroidGeneralDeviceConfiguration();
$requestBody->setOdataType('#microsoft.graph.androidGeneralDeviceConfiguration');
$requestBody->setDescription('Description value');
$requestBody->setDisplayName('Display Name value');
$requestBody->setVersion(7);
$requestBody->setAppsBlockClipboardSharing(true);
$requestBody->setAppsBlockCopyPaste(true);
$requestBody->setAppsBlockYouTube(true);
$requestBody->setBluetoothBlocked(true);
$requestBody->setCameraBlocked(true);
$requestBody->setCellularBlockDataRoaming(true);
$requestBody->setCellularBlockMessaging(true);
$requestBody->setCellularBlockVoiceRoaming(true);
$requestBody->setCellularBlockWiFiTethering(true);
$compliantAppsListAppListItem1 = new AppListItem();
$compliantAppsListAppListItem1->setOdataType('microsoft.graph.appListItem');
$compliantAppsListAppListItem1->setName('Name value');
$compliantAppsListAppListItem1->setPublisher('Publisher value');
$compliantAppsListAppListItem1->setAppStoreUrl('https://example.com/appStoreUrl/');
$compliantAppsListAppListItem1->setAppId('App Id value');
$compliantAppsListArray []= $compliantAppsListAppListItem1;
$requestBody->setCompliantAppsList($compliantAppsListArray);
$requestBody->setCompliantAppListType(new AppListType('appsInListCompliant'));
$requestBody->setDiagnosticDataBlockSubmission(true);
$requestBody->setLocationServicesBlocked(true);
$requestBody->setGoogleAccountBlockAutoSync(true);
$requestBody->setGooglePlayStoreBlocked(true);
$requestBody->setKioskModeBlockSleepButton(true);
$requestBody->setKioskModeBlockVolumeButtons(true);
$kioskModeAppsAppListItem1 = new AppListItem();
$kioskModeAppsAppListItem1->setOdataType('microsoft.graph.appListItem');
$kioskModeAppsAppListItem1->setName('Name value');
$kioskModeAppsAppListItem1->setPublisher('Publisher value');
$kioskModeAppsAppListItem1->setAppStoreUrl('https://example.com/appStoreUrl/');
$kioskModeAppsAppListItem1->setAppId('App Id value');
$kioskModeAppsArray []= $kioskModeAppsAppListItem1;
$requestBody->setKioskModeApps($kioskModeAppsArray);
$requestBody->setNfcBlocked(true);
$requestBody->setPasswordBlockFingerprintUnlock(true);
$requestBody->setPasswordBlockTrustAgents(true);
$requestBody->setPasswordExpirationDays(6);
$requestBody->setPasswordMinimumLength(5);
$requestBody->setPasswordMinutesOfInactivityBeforeScreenTimeout(14);
$requestBody->setPasswordPreviousPasswordBlockCount(2);
$requestBody->setPasswordSignInFailureCountBeforeFactoryReset(12);
$requestBody->setPasswordRequiredType(new AndroidRequiredPasswordType('alphabetic'));
$requestBody->setPasswordRequired(true);
$requestBody->setPowerOffBlocked(true);
$requestBody->setFactoryResetBlocked(true);
$requestBody->setScreenCaptureBlocked(true);
$requestBody->setDeviceSharingAllowed(true);
$requestBody->setStorageBlockGoogleBackup(true);
$requestBody->setStorageBlockRemovableStorage(true);
$requestBody->setStorageRequireDeviceEncryption(true);
$requestBody->setStorageRequireRemovableStorageEncryption(true);
$requestBody->setVoiceAssistantBlocked(true);
$requestBody->setVoiceDialingBlocked(true);
$requestBody->setWebBrowserBlockPopups(true);
$requestBody->setWebBrowserBlockAutofill(true);
$requestBody->setWebBrowserBlockJavaScript(true);
$requestBody->setWebBrowserBlocked(true);
$requestBody->setWebBrowserCookieSettings(new WebBrowserCookieSettings('blockAlways'));
$requestBody->setWiFiBlocked(true);
$appsInstallAllowListAppListItem1 = new AppListItem();
$appsInstallAllowListAppListItem1->setOdataType('microsoft.graph.appListItem');
$appsInstallAllowListAppListItem1->setName('Name value');
$appsInstallAllowListAppListItem1->setPublisher('Publisher value');
$appsInstallAllowListAppListItem1->setAppStoreUrl('https://example.com/appStoreUrl/');
$appsInstallAllowListAppListItem1->setAppId('App Id value');
$appsInstallAllowListArray []= $appsInstallAllowListAppListItem1;
$requestBody->setAppsInstallAllowList($appsInstallAllowListArray);
$appsLaunchBlockListAppListItem1 = new AppListItem();
$appsLaunchBlockListAppListItem1->setOdataType('microsoft.graph.appListItem');
$appsLaunchBlockListAppListItem1->setName('Name value');
$appsLaunchBlockListAppListItem1->setPublisher('Publisher value');
$appsLaunchBlockListAppListItem1->setAppStoreUrl('https://example.com/appStoreUrl/');
$appsLaunchBlockListAppListItem1->setAppId('App Id value');
$appsLaunchBlockListArray []= $appsLaunchBlockListAppListItem1;
$requestBody->setAppsLaunchBlockList($appsLaunchBlockListArray);
$appsHideListAppListItem1 = new AppListItem();
$appsHideListAppListItem1->setOdataType('microsoft.graph.appListItem');
$appsHideListAppListItem1->setName('Name value');
$appsHideListAppListItem1->setPublisher('Publisher value');
$appsHideListAppListItem1->setAppStoreUrl('https://example.com/appStoreUrl/');
$appsHideListAppListItem1->setAppId('App Id value');
$appsHideListArray []= $appsHideListAppListItem1;
$requestBody->setAppsHideList($appsHideListArray);
$requestBody->setSecurityRequireVerifyApps(true);
$result = $graphServiceClient->deviceManagement()->deviceConfigurations()->post($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.androidGeneralDeviceConfiguration"
description = "Description value"
displayName = "Display Name value"
version = 7
appsBlockClipboardSharing = $true
appsBlockCopyPaste = $true
appsBlockYouTube = $true
bluetoothBlocked = $true
cameraBlocked = $true
cellularBlockDataRoaming = $true
cellularBlockMessaging = $true
cellularBlockVoiceRoaming = $true
cellularBlockWiFiTethering = $true
compliantAppsList = @(
@{
"@odata.type" = "microsoft.graph.appListItem"
name = "Name value"
publisher = "Publisher value"
appStoreUrl = "https://example.com/appStoreUrl/"
appId = "App Id value"
}
)
compliantAppListType = "appsInListCompliant"
diagnosticDataBlockSubmission = $true
locationServicesBlocked = $true
googleAccountBlockAutoSync = $true
googlePlayStoreBlocked = $true
kioskModeBlockSleepButton = $true
kioskModeBlockVolumeButtons = $true
kioskModeApps = @(
@{
"@odata.type" = "microsoft.graph.appListItem"
name = "Name value"
publisher = "Publisher value"
appStoreUrl = "https://example.com/appStoreUrl/"
appId = "App Id value"
}
)
nfcBlocked = $true
passwordBlockFingerprintUnlock = $true
passwordBlockTrustAgents = $true
passwordExpirationDays =
passwordMinimumLength =
passwordMinutesOfInactivityBeforeScreenTimeout =
passwordPreviousPasswordBlockCount =
passwordSignInFailureCountBeforeFactoryReset =
passwordRequiredType = "alphabetic"
passwordRequired = $true
powerOffBlocked = $true
factoryResetBlocked = $true
screenCaptureBlocked = $true
deviceSharingAllowed = $true
storageBlockGoogleBackup = $true
storageBlockRemovableStorage = $true
storageRequireDeviceEncryption = $true
storageRequireRemovableStorageEncryption = $true
voiceAssistantBlocked = $true
voiceDialingBlocked = $true
webBrowserBlockPopups = $true
webBrowserBlockAutofill = $true
webBrowserBlockJavaScript = $true
webBrowserBlocked = $true
webBrowserCookieSettings = "blockAlways"
wiFiBlocked = $true
appsInstallAllowList = @(
@{
"@odata.type" = "microsoft.graph.appListItem"
name = "Name value"
publisher = "Publisher value"
appStoreUrl = "https://example.com/appStoreUrl/"
appId = "App Id value"
}
)
appsLaunchBlockList = @(
@{
"@odata.type" = "microsoft.graph.appListItem"
name = "Name value"
publisher = "Publisher value"
appStoreUrl = "https://example.com/appStoreUrl/"
appId = "App Id value"
}
)
appsHideList = @(
@{
"@odata.type" = "microsoft.graph.appListItem"
name = "Name value"
publisher = "Publisher value"
appStoreUrl = "https://example.com/appStoreUrl/"
appId = "App Id value"
}
)
securityRequireVerifyApps = $true
}
New-MgDeviceManagementDeviceConfiguration -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(credentials, scopes)
request_body = AndroidGeneralDeviceConfiguration(
odata_type = "#microsoft.graph.androidGeneralDeviceConfiguration",
description = "Description value",
display_name = "Display Name value",
version = 7,
apps_block_clipboard_sharing = True,
apps_block_copy_paste = True,
apps_block_you_tube = True,
bluetooth_blocked = True,
camera_blocked = True,
cellular_block_data_roaming = True,
cellular_block_messaging = True,
cellular_block_voice_roaming = True,
cellular_block_wi_fi_tethering = True,
compliant_apps_list = [
AppListItem(
odata_type = "microsoft.graph.appListItem",
name = "Name value",
publisher = "Publisher value",
app_store_url = "https://example.com/appStoreUrl/",
app_id = "App Id value",
),
],
compliant_app_list_type = AppListType.AppsInListCompliant,
diagnostic_data_block_submission = True,
location_services_blocked = True,
google_account_block_auto_sync = True,
google_play_store_blocked = True,
kiosk_mode_block_sleep_button = True,
kiosk_mode_block_volume_buttons = True,
kiosk_mode_apps = [
AppListItem(
odata_type = "microsoft.graph.appListItem",
name = "Name value",
publisher = "Publisher value",
app_store_url = "https://example.com/appStoreUrl/",
app_id = "App Id value",
),
],
nfc_blocked = True,
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 = AndroidRequiredPasswordType.Alphabetic,
password_required = True,
power_off_blocked = True,
factory_reset_blocked = True,
screen_capture_blocked = True,
device_sharing_allowed = True,
storage_block_google_backup = True,
storage_block_removable_storage = True,
storage_require_device_encryption = True,
storage_require_removable_storage_encryption = True,
voice_assistant_blocked = True,
voice_dialing_blocked = True,
web_browser_block_popups = True,
web_browser_block_autofill = True,
web_browser_block_java_script = True,
web_browser_blocked = True,
web_browser_cookie_settings = WebBrowserCookieSettings.BlockAlways,
wi_fi_blocked = True,
apps_install_allow_list = [
AppListItem(
odata_type = "microsoft.graph.appListItem",
name = "Name value",
publisher = "Publisher value",
app_store_url = "https://example.com/appStoreUrl/",
app_id = "App Id value",
),
],
apps_launch_block_list = [
AppListItem(
odata_type = "microsoft.graph.appListItem",
name = "Name value",
publisher = "Publisher value",
app_store_url = "https://example.com/appStoreUrl/",
app_id = "App Id value",
),
],
apps_hide_list = [
AppListItem(
odata_type = "microsoft.graph.appListItem",
name = "Name value",
publisher = "Publisher value",
app_store_url = "https://example.com/appStoreUrl/",
app_id = "App Id value",
),
],
security_require_verify_apps = True,
)
result = await graph_client.device_management.device_configurations.post(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.