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 windowsPhone81GeneralConfiguration object.
The following table shows the properties that are required when you create the windowsPhone81GeneralConfiguration.
Here is an example of the request.
POST https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations
Content-type: application/json
Content-length: 1461
{
"@odata.type": "#microsoft.graph.windowsPhone81GeneralConfiguration",
"description": "Description value",
"displayName": "Display Name value",
"version": 7,
"applyOnlyToWindowsPhone81": true,
"appsBlockCopyPaste": true,
"bluetoothBlocked": true,
"cameraBlocked": 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,
"emailBlockAddingAccounts": true,
"locationServicesBlocked": true,
"microsoftAccountBlocked": true,
"nfcBlocked": true,
"passwordBlockSimple": true,
"passwordExpirationDays": 6,
"passwordMinimumLength": 5,
"passwordMinutesOfInactivityBeforeScreenTimeout": 14,
"passwordMinimumCharacterSetCount": 0,
"passwordPreviousPasswordBlockCount": 2,
"passwordSignInFailureCountBeforeFactoryReset": 12,
"passwordRequiredType": "alphanumeric",
"passwordRequired": true,
"screenCaptureBlocked": true,
"storageBlockRemovableStorage": true,
"storageRequireEncryption": true,
"webBrowserBlocked": true,
"wifiBlocked": true,
"wifiBlockAutomaticConnectHotspots": true,
"wifiBlockHotspotReporting": true,
"windowsStoreBlocked": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new WindowsPhone81GeneralConfiguration
{
OdataType = "#microsoft.graph.windowsPhone81GeneralConfiguration",
Description = "Description value",
DisplayName = "Display Name value",
Version = 7,
ApplyOnlyToWindowsPhone81 = true,
AppsBlockCopyPaste = true,
BluetoothBlocked = true,
CameraBlocked = 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,
EmailBlockAddingAccounts = true,
LocationServicesBlocked = true,
MicrosoftAccountBlocked = true,
NfcBlocked = true,
PasswordBlockSimple = true,
PasswordExpirationDays = 6,
PasswordMinimumLength = 5,
PasswordMinutesOfInactivityBeforeScreenTimeout = 14,
PasswordMinimumCharacterSetCount = 0,
PasswordPreviousPasswordBlockCount = 2,
PasswordSignInFailureCountBeforeFactoryReset = 12,
PasswordRequiredType = RequiredPasswordType.Alphanumeric,
PasswordRequired = true,
ScreenCaptureBlocked = true,
StorageBlockRemovableStorage = true,
StorageRequireEncryption = true,
WebBrowserBlocked = true,
WifiBlocked = true,
WifiBlockAutomaticConnectHotspots = true,
WifiBlockHotspotReporting = true,
WindowsStoreBlocked = 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.
mgc device-management device-configurations create --body '{\
"@odata.type": "#microsoft.graph.windowsPhone81GeneralConfiguration",\
"description": "Description value",\
"displayName": "Display Name value",\
"version": 7,\
"applyOnlyToWindowsPhone81": true,\
"appsBlockCopyPaste": true,\
"bluetoothBlocked": true,\
"cameraBlocked": 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,\
"emailBlockAddingAccounts": true,\
"locationServicesBlocked": true,\
"microsoftAccountBlocked": true,\
"nfcBlocked": true,\
"passwordBlockSimple": true,\
"passwordExpirationDays": 6,\
"passwordMinimumLength": 5,\
"passwordMinutesOfInactivityBeforeScreenTimeout": 14,\
"passwordMinimumCharacterSetCount": 0,\
"passwordPreviousPasswordBlockCount": 2,\
"passwordSignInFailureCountBeforeFactoryReset": 12,\
"passwordRequiredType": "alphanumeric",\
"passwordRequired": true,\
"screenCaptureBlocked": true,\
"storageBlockRemovableStorage": true,\
"storageRequireEncryption": true,\
"webBrowserBlocked": true,\
"wifiBlocked": true,\
"wifiBlockAutomaticConnectHotspots": true,\
"wifiBlockHotspotReporting": true,\
"windowsStoreBlocked": 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)
applyOnlyToWindowsPhone81 := true
requestBody.SetApplyOnlyToWindowsPhone81(&applyOnlyToWindowsPhone81)
appsBlockCopyPaste := true
requestBody.SetAppsBlockCopyPaste(&appsBlockCopyPaste)
bluetoothBlocked := true
requestBody.SetBluetoothBlocked(&bluetoothBlocked)
cameraBlocked := true
requestBody.SetCameraBlocked(&cameraBlocked)
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)
emailBlockAddingAccounts := true
requestBody.SetEmailBlockAddingAccounts(&emailBlockAddingAccounts)
locationServicesBlocked := true
requestBody.SetLocationServicesBlocked(&locationServicesBlocked)
microsoftAccountBlocked := true
requestBody.SetMicrosoftAccountBlocked(µsoftAccountBlocked)
nfcBlocked := true
requestBody.SetNfcBlocked(&nfcBlocked)
passwordBlockSimple := true
requestBody.SetPasswordBlockSimple(&passwordBlockSimple)
passwordExpirationDays := int32(6)
requestBody.SetPasswordExpirationDays(&passwordExpirationDays)
passwordMinimumLength := int32(5)
requestBody.SetPasswordMinimumLength(&passwordMinimumLength)
passwordMinutesOfInactivityBeforeScreenTimeout := int32(14)
requestBody.SetPasswordMinutesOfInactivityBeforeScreenTimeout(&passwordMinutesOfInactivityBeforeScreenTimeout)
passwordMinimumCharacterSetCount := int32(0)
requestBody.SetPasswordMinimumCharacterSetCount(&passwordMinimumCharacterSetCount)
passwordPreviousPasswordBlockCount := int32(2)
requestBody.SetPasswordPreviousPasswordBlockCount(&passwordPreviousPasswordBlockCount)
passwordSignInFailureCountBeforeFactoryReset := int32(12)
requestBody.SetPasswordSignInFailureCountBeforeFactoryReset(&passwordSignInFailureCountBeforeFactoryReset)
passwordRequiredType := graphmodels.ALPHANUMERIC_REQUIREDPASSWORDTYPE
requestBody.SetPasswordRequiredType(&passwordRequiredType)
passwordRequired := true
requestBody.SetPasswordRequired(&passwordRequired)
screenCaptureBlocked := true
requestBody.SetScreenCaptureBlocked(&screenCaptureBlocked)
storageBlockRemovableStorage := true
requestBody.SetStorageBlockRemovableStorage(&storageBlockRemovableStorage)
storageRequireEncryption := true
requestBody.SetStorageRequireEncryption(&storageRequireEncryption)
webBrowserBlocked := true
requestBody.SetWebBrowserBlocked(&webBrowserBlocked)
wifiBlocked := true
requestBody.SetWifiBlocked(&wifiBlocked)
wifiBlockAutomaticConnectHotspots := true
requestBody.SetWifiBlockAutomaticConnectHotspots(&wifiBlockAutomaticConnectHotspots)
wifiBlockHotspotReporting := true
requestBody.SetWifiBlockHotspotReporting(&wifiBlockHotspotReporting)
windowsStoreBlocked := true
requestBody.SetWindowsStoreBlocked(&windowsStoreBlocked)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
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.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
WindowsPhone81GeneralConfiguration deviceConfiguration = new WindowsPhone81GeneralConfiguration();
deviceConfiguration.setOdataType("#microsoft.graph.windowsPhone81GeneralConfiguration");
deviceConfiguration.setDescription("Description value");
deviceConfiguration.setDisplayName("Display Name value");
deviceConfiguration.setVersion(7);
deviceConfiguration.setApplyOnlyToWindowsPhone81(true);
deviceConfiguration.setAppsBlockCopyPaste(true);
deviceConfiguration.setBluetoothBlocked(true);
deviceConfiguration.setCameraBlocked(true);
deviceConfiguration.setCellularBlockWifiTethering(true);
LinkedList<AppListItem> compliantAppsList = new LinkedList<AppListItem>();
AppListItem appListItem = new AppListItem();
appListItem.setOdataType("microsoft.graph.appListItem");
appListItem.setName("Name value");
appListItem.setPublisher("Publisher value");
appListItem.setAppStoreUrl("https://example.com/appStoreUrl/");
appListItem.setAppId("App Id value");
compliantAppsList.add(appListItem);
deviceConfiguration.setCompliantAppsList(compliantAppsList);
deviceConfiguration.setCompliantAppListType(AppListType.AppsInListCompliant);
deviceConfiguration.setDiagnosticDataBlockSubmission(true);
deviceConfiguration.setEmailBlockAddingAccounts(true);
deviceConfiguration.setLocationServicesBlocked(true);
deviceConfiguration.setMicrosoftAccountBlocked(true);
deviceConfiguration.setNfcBlocked(true);
deviceConfiguration.setPasswordBlockSimple(true);
deviceConfiguration.setPasswordExpirationDays(6);
deviceConfiguration.setPasswordMinimumLength(5);
deviceConfiguration.setPasswordMinutesOfInactivityBeforeScreenTimeout(14);
deviceConfiguration.setPasswordMinimumCharacterSetCount(0);
deviceConfiguration.setPasswordPreviousPasswordBlockCount(2);
deviceConfiguration.setPasswordSignInFailureCountBeforeFactoryReset(12);
deviceConfiguration.setPasswordRequiredType(RequiredPasswordType.Alphanumeric);
deviceConfiguration.setPasswordRequired(true);
deviceConfiguration.setScreenCaptureBlocked(true);
deviceConfiguration.setStorageBlockRemovableStorage(true);
deviceConfiguration.setStorageRequireEncryption(true);
deviceConfiguration.setWebBrowserBlocked(true);
deviceConfiguration.setWifiBlocked(true);
deviceConfiguration.setWifiBlockAutomaticConnectHotspots(true);
deviceConfiguration.setWifiBlockHotspotReporting(true);
deviceConfiguration.setWindowsStoreBlocked(true);
DeviceConfiguration result = graphClient.deviceManagement().deviceConfigurations().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.windowsPhone81GeneralConfiguration',
description: 'Description value',
displayName: 'Display Name value',
version: 7,
applyOnlyToWindowsPhone81: true,
appsBlockCopyPaste: true,
bluetoothBlocked: true,
cameraBlocked: 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,
emailBlockAddingAccounts: true,
locationServicesBlocked: true,
microsoftAccountBlocked: true,
nfcBlocked: true,
passwordBlockSimple: true,
passwordExpirationDays: 6,
passwordMinimumLength: 5,
passwordMinutesOfInactivityBeforeScreenTimeout: 14,
passwordMinimumCharacterSetCount: 0,
passwordPreviousPasswordBlockCount: 2,
passwordSignInFailureCountBeforeFactoryReset: 12,
passwordRequiredType: 'alphanumeric',
passwordRequired: true,
screenCaptureBlocked: true,
storageBlockRemovableStorage: true,
storageRequireEncryption: true,
webBrowserBlocked: true,
wifiBlocked: true,
wifiBlockAutomaticConnectHotspots: true,
wifiBlockHotspotReporting: true,
windowsStoreBlocked: 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
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\WindowsPhone81GeneralConfiguration;
use Microsoft\Graph\Generated\Models\AppListItem;
use Microsoft\Graph\Generated\Models\AppListType;
use Microsoft\Graph\Generated\Models\RequiredPasswordType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new WindowsPhone81GeneralConfiguration();
$requestBody->setOdataType('#microsoft.graph.windowsPhone81GeneralConfiguration');
$requestBody->setDescription('Description value');
$requestBody->setDisplayName('Display Name value');
$requestBody->setVersion(7);
$requestBody->setApplyOnlyToWindowsPhone81(true);
$requestBody->setAppsBlockCopyPaste(true);
$requestBody->setBluetoothBlocked(true);
$requestBody->setCameraBlocked(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->setEmailBlockAddingAccounts(true);
$requestBody->setLocationServicesBlocked(true);
$requestBody->setMicrosoftAccountBlocked(true);
$requestBody->setNfcBlocked(true);
$requestBody->setPasswordBlockSimple(true);
$requestBody->setPasswordExpirationDays(6);
$requestBody->setPasswordMinimumLength(5);
$requestBody->setPasswordMinutesOfInactivityBeforeScreenTimeout(14);
$requestBody->setPasswordMinimumCharacterSetCount(0);
$requestBody->setPasswordPreviousPasswordBlockCount(2);
$requestBody->setPasswordSignInFailureCountBeforeFactoryReset(12);
$requestBody->setPasswordRequiredType(new RequiredPasswordType('alphanumeric'));
$requestBody->setPasswordRequired(true);
$requestBody->setScreenCaptureBlocked(true);
$requestBody->setStorageBlockRemovableStorage(true);
$requestBody->setStorageRequireEncryption(true);
$requestBody->setWebBrowserBlocked(true);
$requestBody->setWifiBlocked(true);
$requestBody->setWifiBlockAutomaticConnectHotspots(true);
$requestBody->setWifiBlockHotspotReporting(true);
$requestBody->setWindowsStoreBlocked(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.windowsPhone81GeneralConfiguration"
description = "Description value"
displayName = "Display Name value"
version = 7
applyOnlyToWindowsPhone81 = $true
appsBlockCopyPaste = $true
bluetoothBlocked = $true
cameraBlocked = $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
emailBlockAddingAccounts = $true
locationServicesBlocked = $true
microsoftAccountBlocked = $true
nfcBlocked = $true
passwordBlockSimple = $true
passwordExpirationDays =
passwordMinimumLength =
passwordMinutesOfInactivityBeforeScreenTimeout =
passwordMinimumCharacterSetCount =
passwordPreviousPasswordBlockCount =
passwordSignInFailureCountBeforeFactoryReset =
passwordRequiredType = "alphanumeric"
passwordRequired = $true
screenCaptureBlocked = $true
storageBlockRemovableStorage = $true
storageRequireEncryption = $true
webBrowserBlocked = $true
wifiBlocked = $true
wifiBlockAutomaticConnectHotspots = $true
wifiBlockHotspotReporting = $true
windowsStoreBlocked = $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.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.windows_phone81_general_configuration import WindowsPhone81GeneralConfiguration
from msgraph.generated.models.app_list_item import AppListItem
from msgraph.generated.models.app_list_type import AppListType
from msgraph.generated.models.required_password_type import RequiredPasswordType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = WindowsPhone81GeneralConfiguration(
odata_type = "#microsoft.graph.windowsPhone81GeneralConfiguration",
description = "Description value",
display_name = "Display Name value",
version = 7,
apply_only_to_windows_phone81 = True,
apps_block_copy_paste = True,
bluetooth_blocked = True,
camera_blocked = True,
cellular_block_wifi_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,
email_block_adding_accounts = True,
location_services_blocked = True,
microsoft_account_blocked = True,
nfc_blocked = True,
password_block_simple = True,
password_expiration_days = 6,
password_minimum_length = 5,
password_minutes_of_inactivity_before_screen_timeout = 14,
password_minimum_character_set_count = 0,
password_previous_password_block_count = 2,
password_sign_in_failure_count_before_factory_reset = 12,
password_required_type = RequiredPasswordType.Alphanumeric,
password_required = True,
screen_capture_blocked = True,
storage_block_removable_storage = True,
storage_require_encryption = True,
web_browser_blocked = True,
wifi_blocked = True,
wifi_block_automatic_connect_hotspots = True,
wifi_block_hotspot_reporting = True,
windows_store_blocked = 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.