Se requiere uno de los siguientes permisos para llamar a esta API. Para obtener más información, incluido cómo elegir permisos, vea Permisos.
En el cuerpo de la solicitud, especifique una representación JSON del objeto androidGeneralDeviceConfiguration.
En la tabla siguiente se muestran las propiedades necesarias para crear el objeto androidGeneralDeviceConfiguration.
Aquí tiene un ejemplo de la solicitud.
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);
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider, consulte la documentación del SDK.
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\
}\
'
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider, consulte la documentación del SDK.
// 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)
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)
// 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)
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider, consulte la documentación del SDK.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AndroidGeneralDeviceConfiguration deviceConfiguration = new AndroidGeneralDeviceConfiguration();
deviceConfiguration.setOdataType("#microsoft.graph.androidGeneralDeviceConfiguration");
deviceConfiguration.setDescription("Description value");
deviceConfiguration.setDisplayName("Display Name value");
deviceConfiguration.setVersion(7);
deviceConfiguration.setAppsBlockClipboardSharing(true);
deviceConfiguration.setAppsBlockCopyPaste(true);
deviceConfiguration.setAppsBlockYouTube(true);
deviceConfiguration.setBluetoothBlocked(true);
deviceConfiguration.setCameraBlocked(true);
deviceConfiguration.setCellularBlockDataRoaming(true);
deviceConfiguration.setCellularBlockMessaging(true);
deviceConfiguration.setCellularBlockVoiceRoaming(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.setLocationServicesBlocked(true);
deviceConfiguration.setGoogleAccountBlockAutoSync(true);
deviceConfiguration.setGooglePlayStoreBlocked(true);
deviceConfiguration.setKioskModeBlockSleepButton(true);
deviceConfiguration.setKioskModeBlockVolumeButtons(true);
LinkedList<AppListItem> kioskModeApps = new LinkedList<AppListItem>();
AppListItem appListItem1 = new AppListItem();
appListItem1.setOdataType("microsoft.graph.appListItem");
appListItem1.setName("Name value");
appListItem1.setPublisher("Publisher value");
appListItem1.setAppStoreUrl("https://example.com/appStoreUrl/");
appListItem1.setAppId("App Id value");
kioskModeApps.add(appListItem1);
deviceConfiguration.setKioskModeApps(kioskModeApps);
deviceConfiguration.setNfcBlocked(true);
deviceConfiguration.setPasswordBlockFingerprintUnlock(true);
deviceConfiguration.setPasswordBlockTrustAgents(true);
deviceConfiguration.setPasswordExpirationDays(6);
deviceConfiguration.setPasswordMinimumLength(5);
deviceConfiguration.setPasswordMinutesOfInactivityBeforeScreenTimeout(14);
deviceConfiguration.setPasswordPreviousPasswordBlockCount(2);
deviceConfiguration.setPasswordSignInFailureCountBeforeFactoryReset(12);
deviceConfiguration.setPasswordRequiredType(AndroidRequiredPasswordType.Alphabetic);
deviceConfiguration.setPasswordRequired(true);
deviceConfiguration.setPowerOffBlocked(true);
deviceConfiguration.setFactoryResetBlocked(true);
deviceConfiguration.setScreenCaptureBlocked(true);
deviceConfiguration.setDeviceSharingAllowed(true);
deviceConfiguration.setStorageBlockGoogleBackup(true);
deviceConfiguration.setStorageBlockRemovableStorage(true);
deviceConfiguration.setStorageRequireDeviceEncryption(true);
deviceConfiguration.setStorageRequireRemovableStorageEncryption(true);
deviceConfiguration.setVoiceAssistantBlocked(true);
deviceConfiguration.setVoiceDialingBlocked(true);
deviceConfiguration.setWebBrowserBlockPopups(true);
deviceConfiguration.setWebBrowserBlockAutofill(true);
deviceConfiguration.setWebBrowserBlockJavaScript(true);
deviceConfiguration.setWebBrowserBlocked(true);
deviceConfiguration.setWebBrowserCookieSettings(WebBrowserCookieSettings.BlockAlways);
deviceConfiguration.setWiFiBlocked(true);
LinkedList<AppListItem> appsInstallAllowList = new LinkedList<AppListItem>();
AppListItem appListItem2 = new AppListItem();
appListItem2.setOdataType("microsoft.graph.appListItem");
appListItem2.setName("Name value");
appListItem2.setPublisher("Publisher value");
appListItem2.setAppStoreUrl("https://example.com/appStoreUrl/");
appListItem2.setAppId("App Id value");
appsInstallAllowList.add(appListItem2);
deviceConfiguration.setAppsInstallAllowList(appsInstallAllowList);
LinkedList<AppListItem> appsLaunchBlockList = new LinkedList<AppListItem>();
AppListItem appListItem3 = new AppListItem();
appListItem3.setOdataType("microsoft.graph.appListItem");
appListItem3.setName("Name value");
appListItem3.setPublisher("Publisher value");
appListItem3.setAppStoreUrl("https://example.com/appStoreUrl/");
appListItem3.setAppId("App Id value");
appsLaunchBlockList.add(appListItem3);
deviceConfiguration.setAppsLaunchBlockList(appsLaunchBlockList);
LinkedList<AppListItem> appsHideList = new LinkedList<AppListItem>();
AppListItem appListItem4 = new AppListItem();
appListItem4.setOdataType("microsoft.graph.appListItem");
appListItem4.setName("Name value");
appListItem4.setPublisher("Publisher value");
appListItem4.setAppStoreUrl("https://example.com/appStoreUrl/");
appListItem4.setAppId("App Id value");
appsHideList.add(appListItem4);
deviceConfiguration.setAppsHideList(appsHideList);
deviceConfiguration.setSecurityRequireVerifyApps(true);
DeviceConfiguration result = graphClient.deviceManagement().deviceConfigurations().post(deviceConfiguration);
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider, consulte la documentación del SDK.
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);
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider, consulte la documentación del SDK.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\AndroidGeneralDeviceConfiguration;
use Microsoft\Graph\Generated\Models\AppListItem;
use Microsoft\Graph\Generated\Models\AppListType;
use Microsoft\Graph\Generated\Models\AndroidRequiredPasswordType;
use Microsoft\Graph\Generated\Models\WebBrowserCookieSettings;
$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();
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider, consulte la documentación del SDK.
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
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider, consulte la documentación del SDK.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.android_general_device_configuration import AndroidGeneralDeviceConfiguration
from msgraph.generated.models.app_list_item import AppListItem
from msgraph.generated.models.app_list_type import AppListType
from msgraph.generated.models.android_required_password_type import AndroidRequiredPasswordType
from msgraph.generated.models.web_browser_cookie_settings import WebBrowserCookieSettings
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
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)
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider, consulte la documentación del SDK.
Aquí tiene un ejemplo de la respuesta. Nota: Es posible que el objeto de respuesta que aparezca aquí esté truncado para abreviar. Todas las propiedades se devolverán desde una llamada real.