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 iosGeneralDeviceConfiguration object.
The following table shows the properties that are required when you create the iosGeneralDeviceConfiguration.
Here is an example of the request.
POST https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations
Content-type: application/json
Content-length: 7841
{
"@odata.type": "#microsoft.graph.iosGeneralDeviceConfiguration",
"description": "Description value",
"displayName": "Display Name value",
"version": 7,
"accountBlockModification": true,
"activationLockAllowWhenSupervised": true,
"airDropBlocked": true,
"airDropForceUnmanagedDropTarget": true,
"airPlayForcePairingPasswordForOutgoingRequests": true,
"appleWatchBlockPairing": true,
"appleWatchForceWristDetection": true,
"appleNewsBlocked": true,
"appsSingleAppModeList": [
{
"@odata.type": "microsoft.graph.appListItem",
"name": "Name value",
"publisher": "Publisher value",
"appStoreUrl": "https://example.com/appStoreUrl/",
"appId": "App Id value"
}
],
"appsVisibilityList": [
{
"@odata.type": "microsoft.graph.appListItem",
"name": "Name value",
"publisher": "Publisher value",
"appStoreUrl": "https://example.com/appStoreUrl/",
"appId": "App Id value"
}
],
"appsVisibilityListType": "appsInListCompliant",
"appStoreBlockAutomaticDownloads": true,
"appStoreBlocked": true,
"appStoreBlockInAppPurchases": true,
"appStoreBlockUIAppInstallation": true,
"appStoreRequirePassword": true,
"bluetoothBlockModification": true,
"cameraBlocked": true,
"cellularBlockDataRoaming": true,
"cellularBlockGlobalBackgroundFetchWhileRoaming": true,
"cellularBlockPerAppDataModification": true,
"cellularBlockPersonalHotspot": true,
"cellularBlockVoiceRoaming": true,
"certificatesBlockUntrustedTlsCertificates": true,
"classroomAppBlockRemoteScreenObservation": true,
"classroomAppForceUnpromptedScreenObservation": true,
"compliantAppsList": [
{
"@odata.type": "microsoft.graph.appListItem",
"name": "Name value",
"publisher": "Publisher value",
"appStoreUrl": "https://example.com/appStoreUrl/",
"appId": "App Id value"
}
],
"compliantAppListType": "appsInListCompliant",
"configurationProfileBlockChanges": true,
"definitionLookupBlocked": true,
"deviceBlockEnableRestrictions": true,
"deviceBlockEraseContentAndSettings": true,
"deviceBlockNameModification": true,
"diagnosticDataBlockSubmission": true,
"diagnosticDataBlockSubmissionModification": true,
"documentsBlockManagedDocumentsInUnmanagedApps": true,
"documentsBlockUnmanagedDocumentsInManagedApps": true,
"emailInDomainSuffixes": [
"Email In Domain Suffixes value"
],
"enterpriseAppBlockTrust": true,
"enterpriseAppBlockTrustModification": true,
"faceTimeBlocked": true,
"findMyFriendsBlocked": true,
"gamingBlockGameCenterFriends": true,
"gamingBlockMultiplayer": true,
"gameCenterBlocked": true,
"hostPairingBlocked": true,
"iBooksStoreBlocked": true,
"iBooksStoreBlockErotica": true,
"iCloudBlockActivityContinuation": true,
"iCloudBlockBackup": true,
"iCloudBlockDocumentSync": true,
"iCloudBlockManagedAppsSync": true,
"iCloudBlockPhotoLibrary": true,
"iCloudBlockPhotoStreamSync": true,
"iCloudBlockSharedPhotoStream": true,
"iCloudRequireEncryptedBackup": true,
"iTunesBlockExplicitContent": true,
"iTunesBlockMusicService": true,
"iTunesBlockRadio": true,
"keyboardBlockAutoCorrect": true,
"keyboardBlockDictation": true,
"keyboardBlockPredictive": true,
"keyboardBlockShortcuts": true,
"keyboardBlockSpellCheck": true,
"kioskModeAllowAssistiveSpeak": true,
"kioskModeAllowAssistiveTouchSettings": true,
"kioskModeAllowAutoLock": true,
"kioskModeAllowColorInversionSettings": true,
"kioskModeAllowRingerSwitch": true,
"kioskModeAllowScreenRotation": true,
"kioskModeAllowSleepButton": true,
"kioskModeAllowTouchscreen": true,
"kioskModeAllowVoiceOverSettings": true,
"kioskModeAllowVolumeButtons": true,
"kioskModeAllowZoomSettings": true,
"kioskModeAppStoreUrl": "https://example.com/kioskModeAppStoreUrl/",
"kioskModeBuiltInAppId": "Kiosk Mode Built In App Id value",
"kioskModeRequireAssistiveTouch": true,
"kioskModeRequireColorInversion": true,
"kioskModeRequireMonoAudio": true,
"kioskModeRequireVoiceOver": true,
"kioskModeRequireZoom": true,
"kioskModeManagedAppId": "Kiosk Mode Managed App Id value",
"lockScreenBlockControlCenter": true,
"lockScreenBlockNotificationView": true,
"lockScreenBlockPassbook": true,
"lockScreenBlockTodayView": true,
"mediaContentRatingAustralia": {
"@odata.type": "microsoft.graph.mediaContentRatingAustralia",
"movieRating": "allBlocked",
"tvRating": "allBlocked"
},
"mediaContentRatingCanada": {
"@odata.type": "microsoft.graph.mediaContentRatingCanada",
"movieRating": "allBlocked",
"tvRating": "allBlocked"
},
"mediaContentRatingFrance": {
"@odata.type": "microsoft.graph.mediaContentRatingFrance",
"movieRating": "allBlocked",
"tvRating": "allBlocked"
},
"mediaContentRatingGermany": {
"@odata.type": "microsoft.graph.mediaContentRatingGermany",
"movieRating": "allBlocked",
"tvRating": "allBlocked"
},
"mediaContentRatingIreland": {
"@odata.type": "microsoft.graph.mediaContentRatingIreland",
"movieRating": "allBlocked",
"tvRating": "allBlocked"
},
"mediaContentRatingJapan": {
"@odata.type": "microsoft.graph.mediaContentRatingJapan",
"movieRating": "allBlocked",
"tvRating": "allBlocked"
},
"mediaContentRatingNewZealand": {
"@odata.type": "microsoft.graph.mediaContentRatingNewZealand",
"movieRating": "allBlocked",
"tvRating": "allBlocked"
},
"mediaContentRatingUnitedKingdom": {
"@odata.type": "microsoft.graph.mediaContentRatingUnitedKingdom",
"movieRating": "allBlocked",
"tvRating": "allBlocked"
},
"mediaContentRatingUnitedStates": {
"@odata.type": "microsoft.graph.mediaContentRatingUnitedStates",
"movieRating": "allBlocked",
"tvRating": "allBlocked"
},
"networkUsageRules": [
{
"@odata.type": "microsoft.graph.iosNetworkUsageRule",
"managedApps": [
{
"@odata.type": "microsoft.graph.appListItem",
"name": "Name value",
"publisher": "Publisher value",
"appStoreUrl": "https://example.com/appStoreUrl/",
"appId": "App Id value"
}
],
"cellularDataBlockWhenRoaming": true,
"cellularDataBlocked": true
}
],
"mediaContentRatingApps": "allBlocked",
"messagesBlocked": true,
"notificationsBlockSettingsModification": true,
"passcodeBlockFingerprintUnlock": true,
"passcodeBlockFingerprintModification": true,
"passcodeBlockModification": true,
"passcodeBlockSimple": true,
"passcodeExpirationDays": 6,
"passcodeMinimumLength": 5,
"passcodeMinutesOfInactivityBeforeLock": 5,
"passcodeMinutesOfInactivityBeforeScreenTimeout": 14,
"passcodeMinimumCharacterSetCount": 0,
"passcodePreviousPasscodeBlockCount": 2,
"passcodeSignInFailureCountBeforeWipe": 4,
"passcodeRequiredType": "alphanumeric",
"passcodeRequired": true,
"podcastsBlocked": true,
"safariBlockAutofill": true,
"safariBlockJavaScript": true,
"safariBlockPopups": true,
"safariBlocked": true,
"safariCookieSettings": "blockAlways",
"safariManagedDomains": [
"Safari Managed Domains value"
],
"safariPasswordAutoFillDomains": [
"Safari Password Auto Fill Domains value"
],
"safariRequireFraudWarning": true,
"screenCaptureBlocked": true,
"siriBlocked": true,
"siriBlockedWhenLocked": true,
"siriBlockUserGeneratedContent": true,
"siriRequireProfanityFilter": true,
"spotlightBlockInternetResults": true,
"voiceDialingBlocked": true,
"wallpaperBlockModification": true,
"wiFiConnectOnlyToConfiguredNetworks": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new IosGeneralDeviceConfiguration
{
OdataType = "#microsoft.graph.iosGeneralDeviceConfiguration",
Description = "Description value",
DisplayName = "Display Name value",
Version = 7,
AccountBlockModification = true,
ActivationLockAllowWhenSupervised = true,
AirDropBlocked = true,
AirDropForceUnmanagedDropTarget = true,
AirPlayForcePairingPasswordForOutgoingRequests = true,
AppleWatchBlockPairing = true,
AppleWatchForceWristDetection = true,
AppleNewsBlocked = true,
AppsSingleAppModeList = new List<AppListItem>
{
new AppListItem
{
OdataType = "microsoft.graph.appListItem",
Name = "Name value",
Publisher = "Publisher value",
AppStoreUrl = "https://example.com/appStoreUrl/",
AppId = "App Id value",
},
},
AppsVisibilityList = new List<AppListItem>
{
new AppListItem
{
OdataType = "microsoft.graph.appListItem",
Name = "Name value",
Publisher = "Publisher value",
AppStoreUrl = "https://example.com/appStoreUrl/",
AppId = "App Id value",
},
},
AppsVisibilityListType = AppListType.AppsInListCompliant,
AppStoreBlockAutomaticDownloads = true,
AppStoreBlocked = true,
AppStoreBlockInAppPurchases = true,
AppStoreBlockUIAppInstallation = true,
AppStoreRequirePassword = true,
BluetoothBlockModification = true,
CameraBlocked = true,
CellularBlockDataRoaming = true,
CellularBlockGlobalBackgroundFetchWhileRoaming = true,
CellularBlockPerAppDataModification = true,
CellularBlockPersonalHotspot = true,
CellularBlockVoiceRoaming = true,
CertificatesBlockUntrustedTlsCertificates = true,
ClassroomAppBlockRemoteScreenObservation = true,
ClassroomAppForceUnpromptedScreenObservation = 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,
ConfigurationProfileBlockChanges = true,
DefinitionLookupBlocked = true,
DeviceBlockEnableRestrictions = true,
DeviceBlockEraseContentAndSettings = true,
DeviceBlockNameModification = true,
DiagnosticDataBlockSubmission = true,
DiagnosticDataBlockSubmissionModification = true,
DocumentsBlockManagedDocumentsInUnmanagedApps = true,
DocumentsBlockUnmanagedDocumentsInManagedApps = true,
EmailInDomainSuffixes = new List<string>
{
"Email In Domain Suffixes value",
},
EnterpriseAppBlockTrust = true,
EnterpriseAppBlockTrustModification = true,
FaceTimeBlocked = true,
FindMyFriendsBlocked = true,
GamingBlockGameCenterFriends = true,
GamingBlockMultiplayer = true,
GameCenterBlocked = true,
HostPairingBlocked = true,
IBooksStoreBlocked = true,
IBooksStoreBlockErotica = true,
ICloudBlockActivityContinuation = true,
ICloudBlockBackup = true,
ICloudBlockDocumentSync = true,
ICloudBlockManagedAppsSync = true,
ICloudBlockPhotoLibrary = true,
ICloudBlockPhotoStreamSync = true,
ICloudBlockSharedPhotoStream = true,
ICloudRequireEncryptedBackup = true,
ITunesBlockExplicitContent = true,
ITunesBlockMusicService = true,
ITunesBlockRadio = true,
KeyboardBlockAutoCorrect = true,
KeyboardBlockDictation = true,
KeyboardBlockPredictive = true,
KeyboardBlockShortcuts = true,
KeyboardBlockSpellCheck = true,
KioskModeAllowAssistiveSpeak = true,
KioskModeAllowAssistiveTouchSettings = true,
KioskModeAllowAutoLock = true,
KioskModeAllowColorInversionSettings = true,
KioskModeAllowRingerSwitch = true,
KioskModeAllowScreenRotation = true,
KioskModeAllowSleepButton = true,
KioskModeAllowTouchscreen = true,
KioskModeAllowVoiceOverSettings = true,
KioskModeAllowVolumeButtons = true,
KioskModeAllowZoomSettings = true,
KioskModeAppStoreUrl = "https://example.com/kioskModeAppStoreUrl/",
KioskModeBuiltInAppId = "Kiosk Mode Built In App Id value",
KioskModeRequireAssistiveTouch = true,
KioskModeRequireColorInversion = true,
KioskModeRequireMonoAudio = true,
KioskModeRequireVoiceOver = true,
KioskModeRequireZoom = true,
KioskModeManagedAppId = "Kiosk Mode Managed App Id value",
LockScreenBlockControlCenter = true,
LockScreenBlockNotificationView = true,
LockScreenBlockPassbook = true,
LockScreenBlockTodayView = true,
MediaContentRatingAustralia = new MediaContentRatingAustralia
{
OdataType = "microsoft.graph.mediaContentRatingAustralia",
MovieRating = RatingAustraliaMoviesType.AllBlocked,
TvRating = RatingAustraliaTelevisionType.AllBlocked,
},
MediaContentRatingCanada = new MediaContentRatingCanada
{
OdataType = "microsoft.graph.mediaContentRatingCanada",
MovieRating = RatingCanadaMoviesType.AllBlocked,
TvRating = RatingCanadaTelevisionType.AllBlocked,
},
MediaContentRatingFrance = new MediaContentRatingFrance
{
OdataType = "microsoft.graph.mediaContentRatingFrance",
MovieRating = RatingFranceMoviesType.AllBlocked,
TvRating = RatingFranceTelevisionType.AllBlocked,
},
MediaContentRatingGermany = new MediaContentRatingGermany
{
OdataType = "microsoft.graph.mediaContentRatingGermany",
MovieRating = RatingGermanyMoviesType.AllBlocked,
TvRating = RatingGermanyTelevisionType.AllBlocked,
},
MediaContentRatingIreland = new MediaContentRatingIreland
{
OdataType = "microsoft.graph.mediaContentRatingIreland",
MovieRating = RatingIrelandMoviesType.AllBlocked,
TvRating = RatingIrelandTelevisionType.AllBlocked,
},
MediaContentRatingJapan = new MediaContentRatingJapan
{
OdataType = "microsoft.graph.mediaContentRatingJapan",
MovieRating = RatingJapanMoviesType.AllBlocked,
TvRating = RatingJapanTelevisionType.AllBlocked,
},
MediaContentRatingNewZealand = new MediaContentRatingNewZealand
{
OdataType = "microsoft.graph.mediaContentRatingNewZealand",
MovieRating = RatingNewZealandMoviesType.AllBlocked,
TvRating = RatingNewZealandTelevisionType.AllBlocked,
},
MediaContentRatingUnitedKingdom = new MediaContentRatingUnitedKingdom
{
OdataType = "microsoft.graph.mediaContentRatingUnitedKingdom",
MovieRating = RatingUnitedKingdomMoviesType.AllBlocked,
TvRating = RatingUnitedKingdomTelevisionType.AllBlocked,
},
MediaContentRatingUnitedStates = new MediaContentRatingUnitedStates
{
OdataType = "microsoft.graph.mediaContentRatingUnitedStates",
MovieRating = RatingUnitedStatesMoviesType.AllBlocked,
TvRating = RatingUnitedStatesTelevisionType.AllBlocked,
},
NetworkUsageRules = new List<IosNetworkUsageRule>
{
new IosNetworkUsageRule
{
OdataType = "microsoft.graph.iosNetworkUsageRule",
ManagedApps = new List<AppListItem>
{
new AppListItem
{
OdataType = "microsoft.graph.appListItem",
Name = "Name value",
Publisher = "Publisher value",
AppStoreUrl = "https://example.com/appStoreUrl/",
AppId = "App Id value",
},
},
CellularDataBlockWhenRoaming = true,
CellularDataBlocked = true,
},
},
MediaContentRatingApps = RatingAppsType.AllBlocked,
MessagesBlocked = true,
NotificationsBlockSettingsModification = true,
PasscodeBlockFingerprintUnlock = true,
PasscodeBlockFingerprintModification = true,
PasscodeBlockModification = true,
PasscodeBlockSimple = true,
PasscodeExpirationDays = 6,
PasscodeMinimumLength = 5,
PasscodeMinutesOfInactivityBeforeLock = 5,
PasscodeMinutesOfInactivityBeforeScreenTimeout = 14,
PasscodeMinimumCharacterSetCount = 0,
PasscodePreviousPasscodeBlockCount = 2,
PasscodeSignInFailureCountBeforeWipe = 4,
PasscodeRequiredType = RequiredPasswordType.Alphanumeric,
PasscodeRequired = true,
PodcastsBlocked = true,
SafariBlockAutofill = true,
SafariBlockJavaScript = true,
SafariBlockPopups = true,
SafariBlocked = true,
SafariCookieSettings = WebBrowserCookieSettings.BlockAlways,
SafariManagedDomains = new List<string>
{
"Safari Managed Domains value",
},
SafariPasswordAutoFillDomains = new List<string>
{
"Safari Password Auto Fill Domains value",
},
SafariRequireFraudWarning = true,
ScreenCaptureBlocked = true,
SiriBlocked = true,
SiriBlockedWhenLocked = true,
SiriBlockUserGeneratedContent = true,
SiriRequireProfanityFilter = true,
SpotlightBlockInternetResults = true,
VoiceDialingBlocked = true,
WallpaperBlockModification = true,
WiFiConnectOnlyToConfiguredNetworks = 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.iosGeneralDeviceConfiguration",\
"description": "Description value",\
"displayName": "Display Name value",\
"version": 7,\
"accountBlockModification": true,\
"activationLockAllowWhenSupervised": true,\
"airDropBlocked": true,\
"airDropForceUnmanagedDropTarget": true,\
"airPlayForcePairingPasswordForOutgoingRequests": true,\
"appleWatchBlockPairing": true,\
"appleWatchForceWristDetection": true,\
"appleNewsBlocked": true,\
"appsSingleAppModeList": [\
{\
"@odata.type": "microsoft.graph.appListItem",\
"name": "Name value",\
"publisher": "Publisher value",\
"appStoreUrl": "https://example.com/appStoreUrl/",\
"appId": "App Id value"\
}\
],\
"appsVisibilityList": [\
{\
"@odata.type": "microsoft.graph.appListItem",\
"name": "Name value",\
"publisher": "Publisher value",\
"appStoreUrl": "https://example.com/appStoreUrl/",\
"appId": "App Id value"\
}\
],\
"appsVisibilityListType": "appsInListCompliant",\
"appStoreBlockAutomaticDownloads": true,\
"appStoreBlocked": true,\
"appStoreBlockInAppPurchases": true,\
"appStoreBlockUIAppInstallation": true,\
"appStoreRequirePassword": true,\
"bluetoothBlockModification": true,\
"cameraBlocked": true,\
"cellularBlockDataRoaming": true,\
"cellularBlockGlobalBackgroundFetchWhileRoaming": true,\
"cellularBlockPerAppDataModification": true,\
"cellularBlockPersonalHotspot": true,\
"cellularBlockVoiceRoaming": true,\
"certificatesBlockUntrustedTlsCertificates": true,\
"classroomAppBlockRemoteScreenObservation": true,\
"classroomAppForceUnpromptedScreenObservation": true,\
"compliantAppsList": [\
{\
"@odata.type": "microsoft.graph.appListItem",\
"name": "Name value",\
"publisher": "Publisher value",\
"appStoreUrl": "https://example.com/appStoreUrl/",\
"appId": "App Id value"\
}\
],\
"compliantAppListType": "appsInListCompliant",\
"configurationProfileBlockChanges": true,\
"definitionLookupBlocked": true,\
"deviceBlockEnableRestrictions": true,\
"deviceBlockEraseContentAndSettings": true,\
"deviceBlockNameModification": true,\
"diagnosticDataBlockSubmission": true,\
"diagnosticDataBlockSubmissionModification": true,\
"documentsBlockManagedDocumentsInUnmanagedApps": true,\
"documentsBlockUnmanagedDocumentsInManagedApps": true,\
"emailInDomainSuffixes": [\
"Email In Domain Suffixes value"\
],\
"enterpriseAppBlockTrust": true,\
"enterpriseAppBlockTrustModification": true,\
"faceTimeBlocked": true,\
"findMyFriendsBlocked": true,\
"gamingBlockGameCenterFriends": true,\
"gamingBlockMultiplayer": true,\
"gameCenterBlocked": true,\
"hostPairingBlocked": true,\
"iBooksStoreBlocked": true,\
"iBooksStoreBlockErotica": true,\
"iCloudBlockActivityContinuation": true,\
"iCloudBlockBackup": true,\
"iCloudBlockDocumentSync": true,\
"iCloudBlockManagedAppsSync": true,\
"iCloudBlockPhotoLibrary": true,\
"iCloudBlockPhotoStreamSync": true,\
"iCloudBlockSharedPhotoStream": true,\
"iCloudRequireEncryptedBackup": true,\
"iTunesBlockExplicitContent": true,\
"iTunesBlockMusicService": true,\
"iTunesBlockRadio": true,\
"keyboardBlockAutoCorrect": true,\
"keyboardBlockDictation": true,\
"keyboardBlockPredictive": true,\
"keyboardBlockShortcuts": true,\
"keyboardBlockSpellCheck": true,\
"kioskModeAllowAssistiveSpeak": true,\
"kioskModeAllowAssistiveTouchSettings": true,\
"kioskModeAllowAutoLock": true,\
"kioskModeAllowColorInversionSettings": true,\
"kioskModeAllowRingerSwitch": true,\
"kioskModeAllowScreenRotation": true,\
"kioskModeAllowSleepButton": true,\
"kioskModeAllowTouchscreen": true,\
"kioskModeAllowVoiceOverSettings": true,\
"kioskModeAllowVolumeButtons": true,\
"kioskModeAllowZoomSettings": true,\
"kioskModeAppStoreUrl": "https://example.com/kioskModeAppStoreUrl/",\
"kioskModeBuiltInAppId": "Kiosk Mode Built In App Id value",\
"kioskModeRequireAssistiveTouch": true,\
"kioskModeRequireColorInversion": true,\
"kioskModeRequireMonoAudio": true,\
"kioskModeRequireVoiceOver": true,\
"kioskModeRequireZoom": true,\
"kioskModeManagedAppId": "Kiosk Mode Managed App Id value",\
"lockScreenBlockControlCenter": true,\
"lockScreenBlockNotificationView": true,\
"lockScreenBlockPassbook": true,\
"lockScreenBlockTodayView": true,\
"mediaContentRatingAustralia": {\
"@odata.type": "microsoft.graph.mediaContentRatingAustralia",\
"movieRating": "allBlocked",\
"tvRating": "allBlocked"\
},\
"mediaContentRatingCanada": {\
"@odata.type": "microsoft.graph.mediaContentRatingCanada",\
"movieRating": "allBlocked",\
"tvRating": "allBlocked"\
},\
"mediaContentRatingFrance": {\
"@odata.type": "microsoft.graph.mediaContentRatingFrance",\
"movieRating": "allBlocked",\
"tvRating": "allBlocked"\
},\
"mediaContentRatingGermany": {\
"@odata.type": "microsoft.graph.mediaContentRatingGermany",\
"movieRating": "allBlocked",\
"tvRating": "allBlocked"\
},\
"mediaContentRatingIreland": {\
"@odata.type": "microsoft.graph.mediaContentRatingIreland",\
"movieRating": "allBlocked",\
"tvRating": "allBlocked"\
},\
"mediaContentRatingJapan": {\
"@odata.type": "microsoft.graph.mediaContentRatingJapan",\
"movieRating": "allBlocked",\
"tvRating": "allBlocked"\
},\
"mediaContentRatingNewZealand": {\
"@odata.type": "microsoft.graph.mediaContentRatingNewZealand",\
"movieRating": "allBlocked",\
"tvRating": "allBlocked"\
},\
"mediaContentRatingUnitedKingdom": {\
"@odata.type": "microsoft.graph.mediaContentRatingUnitedKingdom",\
"movieRating": "allBlocked",\
"tvRating": "allBlocked"\
},\
"mediaContentRatingUnitedStates": {\
"@odata.type": "microsoft.graph.mediaContentRatingUnitedStates",\
"movieRating": "allBlocked",\
"tvRating": "allBlocked"\
},\
"networkUsageRules": [\
{\
"@odata.type": "microsoft.graph.iosNetworkUsageRule",\
"managedApps": [\
{\
"@odata.type": "microsoft.graph.appListItem",\
"name": "Name value",\
"publisher": "Publisher value",\
"appStoreUrl": "https://example.com/appStoreUrl/",\
"appId": "App Id value"\
}\
],\
"cellularDataBlockWhenRoaming": true,\
"cellularDataBlocked": true\
}\
],\
"mediaContentRatingApps": "allBlocked",\
"messagesBlocked": true,\
"notificationsBlockSettingsModification": true,\
"passcodeBlockFingerprintUnlock": true,\
"passcodeBlockFingerprintModification": true,\
"passcodeBlockModification": true,\
"passcodeBlockSimple": true,\
"passcodeExpirationDays": 6,\
"passcodeMinimumLength": 5,\
"passcodeMinutesOfInactivityBeforeLock": 5,\
"passcodeMinutesOfInactivityBeforeScreenTimeout": 14,\
"passcodeMinimumCharacterSetCount": 0,\
"passcodePreviousPasscodeBlockCount": 2,\
"passcodeSignInFailureCountBeforeWipe": 4,\
"passcodeRequiredType": "alphanumeric",\
"passcodeRequired": true,\
"podcastsBlocked": true,\
"safariBlockAutofill": true,\
"safariBlockJavaScript": true,\
"safariBlockPopups": true,\
"safariBlocked": true,\
"safariCookieSettings": "blockAlways",\
"safariManagedDomains": [\
"Safari Managed Domains value"\
],\
"safariPasswordAutoFillDomains": [\
"Safari Password Auto Fill Domains value"\
],\
"safariRequireFraudWarning": true,\
"screenCaptureBlocked": true,\
"siriBlocked": true,\
"siriBlockedWhenLocked": true,\
"siriBlockUserGeneratedContent": true,\
"siriRequireProfanityFilter": true,\
"spotlightBlockInternetResults": true,\
"voiceDialingBlocked": true,\
"wallpaperBlockModification": true,\
"wiFiConnectOnlyToConfiguredNetworks": 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)
accountBlockModification := true
requestBody.SetAccountBlockModification(&accountBlockModification)
activationLockAllowWhenSupervised := true
requestBody.SetActivationLockAllowWhenSupervised(&activationLockAllowWhenSupervised)
airDropBlocked := true
requestBody.SetAirDropBlocked(&airDropBlocked)
airDropForceUnmanagedDropTarget := true
requestBody.SetAirDropForceUnmanagedDropTarget(&airDropForceUnmanagedDropTarget)
airPlayForcePairingPasswordForOutgoingRequests := true
requestBody.SetAirPlayForcePairingPasswordForOutgoingRequests(&airPlayForcePairingPasswordForOutgoingRequests)
appleWatchBlockPairing := true
requestBody.SetAppleWatchBlockPairing(&appleWatchBlockPairing)
appleWatchForceWristDetection := true
requestBody.SetAppleWatchForceWristDetection(&appleWatchForceWristDetection)
appleNewsBlocked := true
requestBody.SetAppleNewsBlocked(&appleNewsBlocked)
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)
appsSingleAppModeList := []graphmodels.AppListItemable {
appListItem,
}
requestBody.SetAppsSingleAppModeList(appsSingleAppModeList)
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)
appsVisibilityList := []graphmodels.AppListItemable {
appListItem,
}
requestBody.SetAppsVisibilityList(appsVisibilityList)
appsVisibilityListType := graphmodels.APPSINLISTCOMPLIANT_APPLISTTYPE
requestBody.SetAppsVisibilityListType(&appsVisibilityListType)
appStoreBlockAutomaticDownloads := true
requestBody.SetAppStoreBlockAutomaticDownloads(&appStoreBlockAutomaticDownloads)
appStoreBlocked := true
requestBody.SetAppStoreBlocked(&appStoreBlocked)
appStoreBlockInAppPurchases := true
requestBody.SetAppStoreBlockInAppPurchases(&appStoreBlockInAppPurchases)
appStoreBlockUIAppInstallation := true
requestBody.SetAppStoreBlockUIAppInstallation(&appStoreBlockUIAppInstallation)
appStoreRequirePassword := true
requestBody.SetAppStoreRequirePassword(&appStoreRequirePassword)
bluetoothBlockModification := true
requestBody.SetBluetoothBlockModification(&bluetoothBlockModification)
cameraBlocked := true
requestBody.SetCameraBlocked(&cameraBlocked)
cellularBlockDataRoaming := true
requestBody.SetCellularBlockDataRoaming(&cellularBlockDataRoaming)
cellularBlockGlobalBackgroundFetchWhileRoaming := true
requestBody.SetCellularBlockGlobalBackgroundFetchWhileRoaming(&cellularBlockGlobalBackgroundFetchWhileRoaming)
cellularBlockPerAppDataModification := true
requestBody.SetCellularBlockPerAppDataModification(&cellularBlockPerAppDataModification)
cellularBlockPersonalHotspot := true
requestBody.SetCellularBlockPersonalHotspot(&cellularBlockPersonalHotspot)
cellularBlockVoiceRoaming := true
requestBody.SetCellularBlockVoiceRoaming(&cellularBlockVoiceRoaming)
certificatesBlockUntrustedTlsCertificates := true
requestBody.SetCertificatesBlockUntrustedTlsCertificates(&certificatesBlockUntrustedTlsCertificates)
classroomAppBlockRemoteScreenObservation := true
requestBody.SetClassroomAppBlockRemoteScreenObservation(&classroomAppBlockRemoteScreenObservation)
classroomAppForceUnpromptedScreenObservation := true
requestBody.SetClassroomAppForceUnpromptedScreenObservation(&classroomAppForceUnpromptedScreenObservation)
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)
configurationProfileBlockChanges := true
requestBody.SetConfigurationProfileBlockChanges(&configurationProfileBlockChanges)
definitionLookupBlocked := true
requestBody.SetDefinitionLookupBlocked(&definitionLookupBlocked)
deviceBlockEnableRestrictions := true
requestBody.SetDeviceBlockEnableRestrictions(&deviceBlockEnableRestrictions)
deviceBlockEraseContentAndSettings := true
requestBody.SetDeviceBlockEraseContentAndSettings(&deviceBlockEraseContentAndSettings)
deviceBlockNameModification := true
requestBody.SetDeviceBlockNameModification(&deviceBlockNameModification)
diagnosticDataBlockSubmission := true
requestBody.SetDiagnosticDataBlockSubmission(&diagnosticDataBlockSubmission)
diagnosticDataBlockSubmissionModification := true
requestBody.SetDiagnosticDataBlockSubmissionModification(&diagnosticDataBlockSubmissionModification)
documentsBlockManagedDocumentsInUnmanagedApps := true
requestBody.SetDocumentsBlockManagedDocumentsInUnmanagedApps(&documentsBlockManagedDocumentsInUnmanagedApps)
documentsBlockUnmanagedDocumentsInManagedApps := true
requestBody.SetDocumentsBlockUnmanagedDocumentsInManagedApps(&documentsBlockUnmanagedDocumentsInManagedApps)
emailInDomainSuffixes := []string {
"Email In Domain Suffixes value",
}
requestBody.SetEmailInDomainSuffixes(emailInDomainSuffixes)
enterpriseAppBlockTrust := true
requestBody.SetEnterpriseAppBlockTrust(&enterpriseAppBlockTrust)
enterpriseAppBlockTrustModification := true
requestBody.SetEnterpriseAppBlockTrustModification(&enterpriseAppBlockTrustModification)
faceTimeBlocked := true
requestBody.SetFaceTimeBlocked(&faceTimeBlocked)
findMyFriendsBlocked := true
requestBody.SetFindMyFriendsBlocked(&findMyFriendsBlocked)
gamingBlockGameCenterFriends := true
requestBody.SetGamingBlockGameCenterFriends(&gamingBlockGameCenterFriends)
gamingBlockMultiplayer := true
requestBody.SetGamingBlockMultiplayer(&gamingBlockMultiplayer)
gameCenterBlocked := true
requestBody.SetGameCenterBlocked(&gameCenterBlocked)
hostPairingBlocked := true
requestBody.SetHostPairingBlocked(&hostPairingBlocked)
iBooksStoreBlocked := true
requestBody.SetIBooksStoreBlocked(&iBooksStoreBlocked)
iBooksStoreBlockErotica := true
requestBody.SetIBooksStoreBlockErotica(&iBooksStoreBlockErotica)
iCloudBlockActivityContinuation := true
requestBody.SetICloudBlockActivityContinuation(&iCloudBlockActivityContinuation)
iCloudBlockBackup := true
requestBody.SetICloudBlockBackup(&iCloudBlockBackup)
iCloudBlockDocumentSync := true
requestBody.SetICloudBlockDocumentSync(&iCloudBlockDocumentSync)
iCloudBlockManagedAppsSync := true
requestBody.SetICloudBlockManagedAppsSync(&iCloudBlockManagedAppsSync)
iCloudBlockPhotoLibrary := true
requestBody.SetICloudBlockPhotoLibrary(&iCloudBlockPhotoLibrary)
iCloudBlockPhotoStreamSync := true
requestBody.SetICloudBlockPhotoStreamSync(&iCloudBlockPhotoStreamSync)
iCloudBlockSharedPhotoStream := true
requestBody.SetICloudBlockSharedPhotoStream(&iCloudBlockSharedPhotoStream)
iCloudRequireEncryptedBackup := true
requestBody.SetICloudRequireEncryptedBackup(&iCloudRequireEncryptedBackup)
iTunesBlockExplicitContent := true
requestBody.SetITunesBlockExplicitContent(&iTunesBlockExplicitContent)
iTunesBlockMusicService := true
requestBody.SetITunesBlockMusicService(&iTunesBlockMusicService)
iTunesBlockRadio := true
requestBody.SetITunesBlockRadio(&iTunesBlockRadio)
keyboardBlockAutoCorrect := true
requestBody.SetKeyboardBlockAutoCorrect(&keyboardBlockAutoCorrect)
keyboardBlockDictation := true
requestBody.SetKeyboardBlockDictation(&keyboardBlockDictation)
keyboardBlockPredictive := true
requestBody.SetKeyboardBlockPredictive(&keyboardBlockPredictive)
keyboardBlockShortcuts := true
requestBody.SetKeyboardBlockShortcuts(&keyboardBlockShortcuts)
keyboardBlockSpellCheck := true
requestBody.SetKeyboardBlockSpellCheck(&keyboardBlockSpellCheck)
kioskModeAllowAssistiveSpeak := true
requestBody.SetKioskModeAllowAssistiveSpeak(&kioskModeAllowAssistiveSpeak)
kioskModeAllowAssistiveTouchSettings := true
requestBody.SetKioskModeAllowAssistiveTouchSettings(&kioskModeAllowAssistiveTouchSettings)
kioskModeAllowAutoLock := true
requestBody.SetKioskModeAllowAutoLock(&kioskModeAllowAutoLock)
kioskModeAllowColorInversionSettings := true
requestBody.SetKioskModeAllowColorInversionSettings(&kioskModeAllowColorInversionSettings)
kioskModeAllowRingerSwitch := true
requestBody.SetKioskModeAllowRingerSwitch(&kioskModeAllowRingerSwitch)
kioskModeAllowScreenRotation := true
requestBody.SetKioskModeAllowScreenRotation(&kioskModeAllowScreenRotation)
kioskModeAllowSleepButton := true
requestBody.SetKioskModeAllowSleepButton(&kioskModeAllowSleepButton)
kioskModeAllowTouchscreen := true
requestBody.SetKioskModeAllowTouchscreen(&kioskModeAllowTouchscreen)
kioskModeAllowVoiceOverSettings := true
requestBody.SetKioskModeAllowVoiceOverSettings(&kioskModeAllowVoiceOverSettings)
kioskModeAllowVolumeButtons := true
requestBody.SetKioskModeAllowVolumeButtons(&kioskModeAllowVolumeButtons)
kioskModeAllowZoomSettings := true
requestBody.SetKioskModeAllowZoomSettings(&kioskModeAllowZoomSettings)
kioskModeAppStoreUrl := "https://example.com/kioskModeAppStoreUrl/"
requestBody.SetKioskModeAppStoreUrl(&kioskModeAppStoreUrl)
kioskModeBuiltInAppId := "Kiosk Mode Built In App Id value"
requestBody.SetKioskModeBuiltInAppId(&kioskModeBuiltInAppId)
kioskModeRequireAssistiveTouch := true
requestBody.SetKioskModeRequireAssistiveTouch(&kioskModeRequireAssistiveTouch)
kioskModeRequireColorInversion := true
requestBody.SetKioskModeRequireColorInversion(&kioskModeRequireColorInversion)
kioskModeRequireMonoAudio := true
requestBody.SetKioskModeRequireMonoAudio(&kioskModeRequireMonoAudio)
kioskModeRequireVoiceOver := true
requestBody.SetKioskModeRequireVoiceOver(&kioskModeRequireVoiceOver)
kioskModeRequireZoom := true
requestBody.SetKioskModeRequireZoom(&kioskModeRequireZoom)
kioskModeManagedAppId := "Kiosk Mode Managed App Id value"
requestBody.SetKioskModeManagedAppId(&kioskModeManagedAppId)
lockScreenBlockControlCenter := true
requestBody.SetLockScreenBlockControlCenter(&lockScreenBlockControlCenter)
lockScreenBlockNotificationView := true
requestBody.SetLockScreenBlockNotificationView(&lockScreenBlockNotificationView)
lockScreenBlockPassbook := true
requestBody.SetLockScreenBlockPassbook(&lockScreenBlockPassbook)
lockScreenBlockTodayView := true
requestBody.SetLockScreenBlockTodayView(&lockScreenBlockTodayView)
mediaContentRatingAustralia := graphmodels.NewMediaContentRatingAustralia()
movieRating := graphmodels.ALLBLOCKED_RATINGAUSTRALIAMOVIESTYPE
mediaContentRatingAustralia.SetMovieRating(&movieRating)
tvRating := graphmodels.ALLBLOCKED_RATINGAUSTRALIATELEVISIONTYPE
mediaContentRatingAustralia.SetTvRating(&tvRating)
requestBody.SetMediaContentRatingAustralia(mediaContentRatingAustralia)
mediaContentRatingCanada := graphmodels.NewMediaContentRatingCanada()
movieRating := graphmodels.ALLBLOCKED_RATINGCANADAMOVIESTYPE
mediaContentRatingCanada.SetMovieRating(&movieRating)
tvRating := graphmodels.ALLBLOCKED_RATINGCANADATELEVISIONTYPE
mediaContentRatingCanada.SetTvRating(&tvRating)
requestBody.SetMediaContentRatingCanada(mediaContentRatingCanada)
mediaContentRatingFrance := graphmodels.NewMediaContentRatingFrance()
movieRating := graphmodels.ALLBLOCKED_RATINGFRANCEMOVIESTYPE
mediaContentRatingFrance.SetMovieRating(&movieRating)
tvRating := graphmodels.ALLBLOCKED_RATINGFRANCETELEVISIONTYPE
mediaContentRatingFrance.SetTvRating(&tvRating)
requestBody.SetMediaContentRatingFrance(mediaContentRatingFrance)
mediaContentRatingGermany := graphmodels.NewMediaContentRatingGermany()
movieRating := graphmodels.ALLBLOCKED_RATINGGERMANYMOVIESTYPE
mediaContentRatingGermany.SetMovieRating(&movieRating)
tvRating := graphmodels.ALLBLOCKED_RATINGGERMANYTELEVISIONTYPE
mediaContentRatingGermany.SetTvRating(&tvRating)
requestBody.SetMediaContentRatingGermany(mediaContentRatingGermany)
mediaContentRatingIreland := graphmodels.NewMediaContentRatingIreland()
movieRating := graphmodels.ALLBLOCKED_RATINGIRELANDMOVIESTYPE
mediaContentRatingIreland.SetMovieRating(&movieRating)
tvRating := graphmodels.ALLBLOCKED_RATINGIRELANDTELEVISIONTYPE
mediaContentRatingIreland.SetTvRating(&tvRating)
requestBody.SetMediaContentRatingIreland(mediaContentRatingIreland)
mediaContentRatingJapan := graphmodels.NewMediaContentRatingJapan()
movieRating := graphmodels.ALLBLOCKED_RATINGJAPANMOVIESTYPE
mediaContentRatingJapan.SetMovieRating(&movieRating)
tvRating := graphmodels.ALLBLOCKED_RATINGJAPANTELEVISIONTYPE
mediaContentRatingJapan.SetTvRating(&tvRating)
requestBody.SetMediaContentRatingJapan(mediaContentRatingJapan)
mediaContentRatingNewZealand := graphmodels.NewMediaContentRatingNewZealand()
movieRating := graphmodels.ALLBLOCKED_RATINGNEWZEALANDMOVIESTYPE
mediaContentRatingNewZealand.SetMovieRating(&movieRating)
tvRating := graphmodels.ALLBLOCKED_RATINGNEWZEALANDTELEVISIONTYPE
mediaContentRatingNewZealand.SetTvRating(&tvRating)
requestBody.SetMediaContentRatingNewZealand(mediaContentRatingNewZealand)
mediaContentRatingUnitedKingdom := graphmodels.NewMediaContentRatingUnitedKingdom()
movieRating := graphmodels.ALLBLOCKED_RATINGUNITEDKINGDOMMOVIESTYPE
mediaContentRatingUnitedKingdom.SetMovieRating(&movieRating)
tvRating := graphmodels.ALLBLOCKED_RATINGUNITEDKINGDOMTELEVISIONTYPE
mediaContentRatingUnitedKingdom.SetTvRating(&tvRating)
requestBody.SetMediaContentRatingUnitedKingdom(mediaContentRatingUnitedKingdom)
mediaContentRatingUnitedStates := graphmodels.NewMediaContentRatingUnitedStates()
movieRating := graphmodels.ALLBLOCKED_RATINGUNITEDSTATESMOVIESTYPE
mediaContentRatingUnitedStates.SetMovieRating(&movieRating)
tvRating := graphmodels.ALLBLOCKED_RATINGUNITEDSTATESTELEVISIONTYPE
mediaContentRatingUnitedStates.SetTvRating(&tvRating)
requestBody.SetMediaContentRatingUnitedStates(mediaContentRatingUnitedStates)
iosNetworkUsageRule := graphmodels.NewIosNetworkUsageRule()
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)
managedApps := []graphmodels.AppListItemable {
appListItem,
}
iosNetworkUsageRule.SetManagedApps(managedApps)
cellularDataBlockWhenRoaming := true
iosNetworkUsageRule.SetCellularDataBlockWhenRoaming(&cellularDataBlockWhenRoaming)
cellularDataBlocked := true
iosNetworkUsageRule.SetCellularDataBlocked(&cellularDataBlocked)
networkUsageRules := []graphmodels.IosNetworkUsageRuleable {
iosNetworkUsageRule,
}
requestBody.SetNetworkUsageRules(networkUsageRules)
mediaContentRatingApps := graphmodels.ALLBLOCKED_RATINGAPPSTYPE
requestBody.SetMediaContentRatingApps(&mediaContentRatingApps)
messagesBlocked := true
requestBody.SetMessagesBlocked(&messagesBlocked)
notificationsBlockSettingsModification := true
requestBody.SetNotificationsBlockSettingsModification(¬ificationsBlockSettingsModification)
passcodeBlockFingerprintUnlock := true
requestBody.SetPasscodeBlockFingerprintUnlock(&passcodeBlockFingerprintUnlock)
passcodeBlockFingerprintModification := true
requestBody.SetPasscodeBlockFingerprintModification(&passcodeBlockFingerprintModification)
passcodeBlockModification := true
requestBody.SetPasscodeBlockModification(&passcodeBlockModification)
passcodeBlockSimple := true
requestBody.SetPasscodeBlockSimple(&passcodeBlockSimple)
passcodeExpirationDays := int32(6)
requestBody.SetPasscodeExpirationDays(&passcodeExpirationDays)
passcodeMinimumLength := int32(5)
requestBody.SetPasscodeMinimumLength(&passcodeMinimumLength)
passcodeMinutesOfInactivityBeforeLock := int32(5)
requestBody.SetPasscodeMinutesOfInactivityBeforeLock(&passcodeMinutesOfInactivityBeforeLock)
passcodeMinutesOfInactivityBeforeScreenTimeout := int32(14)
requestBody.SetPasscodeMinutesOfInactivityBeforeScreenTimeout(&passcodeMinutesOfInactivityBeforeScreenTimeout)
passcodeMinimumCharacterSetCount := int32(0)
requestBody.SetPasscodeMinimumCharacterSetCount(&passcodeMinimumCharacterSetCount)
passcodePreviousPasscodeBlockCount := int32(2)
requestBody.SetPasscodePreviousPasscodeBlockCount(&passcodePreviousPasscodeBlockCount)
passcodeSignInFailureCountBeforeWipe := int32(4)
requestBody.SetPasscodeSignInFailureCountBeforeWipe(&passcodeSignInFailureCountBeforeWipe)
passcodeRequiredType := graphmodels.ALPHANUMERIC_REQUIREDPASSWORDTYPE
requestBody.SetPasscodeRequiredType(&passcodeRequiredType)
passcodeRequired := true
requestBody.SetPasscodeRequired(&passcodeRequired)
podcastsBlocked := true
requestBody.SetPodcastsBlocked(&podcastsBlocked)
safariBlockAutofill := true
requestBody.SetSafariBlockAutofill(&safariBlockAutofill)
safariBlockJavaScript := true
requestBody.SetSafariBlockJavaScript(&safariBlockJavaScript)
safariBlockPopups := true
requestBody.SetSafariBlockPopups(&safariBlockPopups)
safariBlocked := true
requestBody.SetSafariBlocked(&safariBlocked)
safariCookieSettings := graphmodels.BLOCKALWAYS_WEBBROWSERCOOKIESETTINGS
requestBody.SetSafariCookieSettings(&safariCookieSettings)
safariManagedDomains := []string {
"Safari Managed Domains value",
}
requestBody.SetSafariManagedDomains(safariManagedDomains)
safariPasswordAutoFillDomains := []string {
"Safari Password Auto Fill Domains value",
}
requestBody.SetSafariPasswordAutoFillDomains(safariPasswordAutoFillDomains)
safariRequireFraudWarning := true
requestBody.SetSafariRequireFraudWarning(&safariRequireFraudWarning)
screenCaptureBlocked := true
requestBody.SetScreenCaptureBlocked(&screenCaptureBlocked)
siriBlocked := true
requestBody.SetSiriBlocked(&siriBlocked)
siriBlockedWhenLocked := true
requestBody.SetSiriBlockedWhenLocked(&siriBlockedWhenLocked)
siriBlockUserGeneratedContent := true
requestBody.SetSiriBlockUserGeneratedContent(&siriBlockUserGeneratedContent)
siriRequireProfanityFilter := true
requestBody.SetSiriRequireProfanityFilter(&siriRequireProfanityFilter)
spotlightBlockInternetResults := true
requestBody.SetSpotlightBlockInternetResults(&spotlightBlockInternetResults)
voiceDialingBlocked := true
requestBody.SetVoiceDialingBlocked(&voiceDialingBlocked)
wallpaperBlockModification := true
requestBody.SetWallpaperBlockModification(&wallpaperBlockModification)
wiFiConnectOnlyToConfiguredNetworks := true
requestBody.SetWiFiConnectOnlyToConfiguredNetworks(&wiFiConnectOnlyToConfiguredNetworks)
// 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);
IosGeneralDeviceConfiguration deviceConfiguration = new IosGeneralDeviceConfiguration();
deviceConfiguration.setOdataType("#microsoft.graph.iosGeneralDeviceConfiguration");
deviceConfiguration.setDescription("Description value");
deviceConfiguration.setDisplayName("Display Name value");
deviceConfiguration.setVersion(7);
deviceConfiguration.setAccountBlockModification(true);
deviceConfiguration.setActivationLockAllowWhenSupervised(true);
deviceConfiguration.setAirDropBlocked(true);
deviceConfiguration.setAirDropForceUnmanagedDropTarget(true);
deviceConfiguration.setAirPlayForcePairingPasswordForOutgoingRequests(true);
deviceConfiguration.setAppleWatchBlockPairing(true);
deviceConfiguration.setAppleWatchForceWristDetection(true);
deviceConfiguration.setAppleNewsBlocked(true);
LinkedList<AppListItem> appsSingleAppModeList = 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");
appsSingleAppModeList.add(appListItem);
deviceConfiguration.setAppsSingleAppModeList(appsSingleAppModeList);
LinkedList<AppListItem> appsVisibilityList = 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");
appsVisibilityList.add(appListItem1);
deviceConfiguration.setAppsVisibilityList(appsVisibilityList);
deviceConfiguration.setAppsVisibilityListType(AppListType.AppsInListCompliant);
deviceConfiguration.setAppStoreBlockAutomaticDownloads(true);
deviceConfiguration.setAppStoreBlocked(true);
deviceConfiguration.setAppStoreBlockInAppPurchases(true);
deviceConfiguration.setAppStoreBlockUIAppInstallation(true);
deviceConfiguration.setAppStoreRequirePassword(true);
deviceConfiguration.setBluetoothBlockModification(true);
deviceConfiguration.setCameraBlocked(true);
deviceConfiguration.setCellularBlockDataRoaming(true);
deviceConfiguration.setCellularBlockGlobalBackgroundFetchWhileRoaming(true);
deviceConfiguration.setCellularBlockPerAppDataModification(true);
deviceConfiguration.setCellularBlockPersonalHotspot(true);
deviceConfiguration.setCellularBlockVoiceRoaming(true);
deviceConfiguration.setCertificatesBlockUntrustedTlsCertificates(true);
deviceConfiguration.setClassroomAppBlockRemoteScreenObservation(true);
deviceConfiguration.setClassroomAppForceUnpromptedScreenObservation(true);
LinkedList<AppListItem> compliantAppsList = 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");
compliantAppsList.add(appListItem2);
deviceConfiguration.setCompliantAppsList(compliantAppsList);
deviceConfiguration.setCompliantAppListType(AppListType.AppsInListCompliant);
deviceConfiguration.setConfigurationProfileBlockChanges(true);
deviceConfiguration.setDefinitionLookupBlocked(true);
deviceConfiguration.setDeviceBlockEnableRestrictions(true);
deviceConfiguration.setDeviceBlockEraseContentAndSettings(true);
deviceConfiguration.setDeviceBlockNameModification(true);
deviceConfiguration.setDiagnosticDataBlockSubmission(true);
deviceConfiguration.setDiagnosticDataBlockSubmissionModification(true);
deviceConfiguration.setDocumentsBlockManagedDocumentsInUnmanagedApps(true);
deviceConfiguration.setDocumentsBlockUnmanagedDocumentsInManagedApps(true);
LinkedList<String> emailInDomainSuffixes = new LinkedList<String>();
emailInDomainSuffixes.add("Email In Domain Suffixes value");
deviceConfiguration.setEmailInDomainSuffixes(emailInDomainSuffixes);
deviceConfiguration.setEnterpriseAppBlockTrust(true);
deviceConfiguration.setEnterpriseAppBlockTrustModification(true);
deviceConfiguration.setFaceTimeBlocked(true);
deviceConfiguration.setFindMyFriendsBlocked(true);
deviceConfiguration.setGamingBlockGameCenterFriends(true);
deviceConfiguration.setGamingBlockMultiplayer(true);
deviceConfiguration.setGameCenterBlocked(true);
deviceConfiguration.setHostPairingBlocked(true);
deviceConfiguration.setIBooksStoreBlocked(true);
deviceConfiguration.setIBooksStoreBlockErotica(true);
deviceConfiguration.setICloudBlockActivityContinuation(true);
deviceConfiguration.setICloudBlockBackup(true);
deviceConfiguration.setICloudBlockDocumentSync(true);
deviceConfiguration.setICloudBlockManagedAppsSync(true);
deviceConfiguration.setICloudBlockPhotoLibrary(true);
deviceConfiguration.setICloudBlockPhotoStreamSync(true);
deviceConfiguration.setICloudBlockSharedPhotoStream(true);
deviceConfiguration.setICloudRequireEncryptedBackup(true);
deviceConfiguration.setITunesBlockExplicitContent(true);
deviceConfiguration.setITunesBlockMusicService(true);
deviceConfiguration.setITunesBlockRadio(true);
deviceConfiguration.setKeyboardBlockAutoCorrect(true);
deviceConfiguration.setKeyboardBlockDictation(true);
deviceConfiguration.setKeyboardBlockPredictive(true);
deviceConfiguration.setKeyboardBlockShortcuts(true);
deviceConfiguration.setKeyboardBlockSpellCheck(true);
deviceConfiguration.setKioskModeAllowAssistiveSpeak(true);
deviceConfiguration.setKioskModeAllowAssistiveTouchSettings(true);
deviceConfiguration.setKioskModeAllowAutoLock(true);
deviceConfiguration.setKioskModeAllowColorInversionSettings(true);
deviceConfiguration.setKioskModeAllowRingerSwitch(true);
deviceConfiguration.setKioskModeAllowScreenRotation(true);
deviceConfiguration.setKioskModeAllowSleepButton(true);
deviceConfiguration.setKioskModeAllowTouchscreen(true);
deviceConfiguration.setKioskModeAllowVoiceOverSettings(true);
deviceConfiguration.setKioskModeAllowVolumeButtons(true);
deviceConfiguration.setKioskModeAllowZoomSettings(true);
deviceConfiguration.setKioskModeAppStoreUrl("https://example.com/kioskModeAppStoreUrl/");
deviceConfiguration.setKioskModeBuiltInAppId("Kiosk Mode Built In App Id value");
deviceConfiguration.setKioskModeRequireAssistiveTouch(true);
deviceConfiguration.setKioskModeRequireColorInversion(true);
deviceConfiguration.setKioskModeRequireMonoAudio(true);
deviceConfiguration.setKioskModeRequireVoiceOver(true);
deviceConfiguration.setKioskModeRequireZoom(true);
deviceConfiguration.setKioskModeManagedAppId("Kiosk Mode Managed App Id value");
deviceConfiguration.setLockScreenBlockControlCenter(true);
deviceConfiguration.setLockScreenBlockNotificationView(true);
deviceConfiguration.setLockScreenBlockPassbook(true);
deviceConfiguration.setLockScreenBlockTodayView(true);
MediaContentRatingAustralia mediaContentRatingAustralia = new MediaContentRatingAustralia();
mediaContentRatingAustralia.setOdataType("microsoft.graph.mediaContentRatingAustralia");
mediaContentRatingAustralia.setMovieRating(RatingAustraliaMoviesType.AllBlocked);
mediaContentRatingAustralia.setTvRating(RatingAustraliaTelevisionType.AllBlocked);
deviceConfiguration.setMediaContentRatingAustralia(mediaContentRatingAustralia);
MediaContentRatingCanada mediaContentRatingCanada = new MediaContentRatingCanada();
mediaContentRatingCanada.setOdataType("microsoft.graph.mediaContentRatingCanada");
mediaContentRatingCanada.setMovieRating(RatingCanadaMoviesType.AllBlocked);
mediaContentRatingCanada.setTvRating(RatingCanadaTelevisionType.AllBlocked);
deviceConfiguration.setMediaContentRatingCanada(mediaContentRatingCanada);
MediaContentRatingFrance mediaContentRatingFrance = new MediaContentRatingFrance();
mediaContentRatingFrance.setOdataType("microsoft.graph.mediaContentRatingFrance");
mediaContentRatingFrance.setMovieRating(RatingFranceMoviesType.AllBlocked);
mediaContentRatingFrance.setTvRating(RatingFranceTelevisionType.AllBlocked);
deviceConfiguration.setMediaContentRatingFrance(mediaContentRatingFrance);
MediaContentRatingGermany mediaContentRatingGermany = new MediaContentRatingGermany();
mediaContentRatingGermany.setOdataType("microsoft.graph.mediaContentRatingGermany");
mediaContentRatingGermany.setMovieRating(RatingGermanyMoviesType.AllBlocked);
mediaContentRatingGermany.setTvRating(RatingGermanyTelevisionType.AllBlocked);
deviceConfiguration.setMediaContentRatingGermany(mediaContentRatingGermany);
MediaContentRatingIreland mediaContentRatingIreland = new MediaContentRatingIreland();
mediaContentRatingIreland.setOdataType("microsoft.graph.mediaContentRatingIreland");
mediaContentRatingIreland.setMovieRating(RatingIrelandMoviesType.AllBlocked);
mediaContentRatingIreland.setTvRating(RatingIrelandTelevisionType.AllBlocked);
deviceConfiguration.setMediaContentRatingIreland(mediaContentRatingIreland);
MediaContentRatingJapan mediaContentRatingJapan = new MediaContentRatingJapan();
mediaContentRatingJapan.setOdataType("microsoft.graph.mediaContentRatingJapan");
mediaContentRatingJapan.setMovieRating(RatingJapanMoviesType.AllBlocked);
mediaContentRatingJapan.setTvRating(RatingJapanTelevisionType.AllBlocked);
deviceConfiguration.setMediaContentRatingJapan(mediaContentRatingJapan);
MediaContentRatingNewZealand mediaContentRatingNewZealand = new MediaContentRatingNewZealand();
mediaContentRatingNewZealand.setOdataType("microsoft.graph.mediaContentRatingNewZealand");
mediaContentRatingNewZealand.setMovieRating(RatingNewZealandMoviesType.AllBlocked);
mediaContentRatingNewZealand.setTvRating(RatingNewZealandTelevisionType.AllBlocked);
deviceConfiguration.setMediaContentRatingNewZealand(mediaContentRatingNewZealand);
MediaContentRatingUnitedKingdom mediaContentRatingUnitedKingdom = new MediaContentRatingUnitedKingdom();
mediaContentRatingUnitedKingdom.setOdataType("microsoft.graph.mediaContentRatingUnitedKingdom");
mediaContentRatingUnitedKingdom.setMovieRating(RatingUnitedKingdomMoviesType.AllBlocked);
mediaContentRatingUnitedKingdom.setTvRating(RatingUnitedKingdomTelevisionType.AllBlocked);
deviceConfiguration.setMediaContentRatingUnitedKingdom(mediaContentRatingUnitedKingdom);
MediaContentRatingUnitedStates mediaContentRatingUnitedStates = new MediaContentRatingUnitedStates();
mediaContentRatingUnitedStates.setOdataType("microsoft.graph.mediaContentRatingUnitedStates");
mediaContentRatingUnitedStates.setMovieRating(RatingUnitedStatesMoviesType.AllBlocked);
mediaContentRatingUnitedStates.setTvRating(RatingUnitedStatesTelevisionType.AllBlocked);
deviceConfiguration.setMediaContentRatingUnitedStates(mediaContentRatingUnitedStates);
LinkedList<IosNetworkUsageRule> networkUsageRules = new LinkedList<IosNetworkUsageRule>();
IosNetworkUsageRule iosNetworkUsageRule = new IosNetworkUsageRule();
iosNetworkUsageRule.setOdataType("microsoft.graph.iosNetworkUsageRule");
LinkedList<AppListItem> managedApps = 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");
managedApps.add(appListItem3);
iosNetworkUsageRule.setManagedApps(managedApps);
iosNetworkUsageRule.setCellularDataBlockWhenRoaming(true);
iosNetworkUsageRule.setCellularDataBlocked(true);
networkUsageRules.add(iosNetworkUsageRule);
deviceConfiguration.setNetworkUsageRules(networkUsageRules);
deviceConfiguration.setMediaContentRatingApps(RatingAppsType.AllBlocked);
deviceConfiguration.setMessagesBlocked(true);
deviceConfiguration.setNotificationsBlockSettingsModification(true);
deviceConfiguration.setPasscodeBlockFingerprintUnlock(true);
deviceConfiguration.setPasscodeBlockFingerprintModification(true);
deviceConfiguration.setPasscodeBlockModification(true);
deviceConfiguration.setPasscodeBlockSimple(true);
deviceConfiguration.setPasscodeExpirationDays(6);
deviceConfiguration.setPasscodeMinimumLength(5);
deviceConfiguration.setPasscodeMinutesOfInactivityBeforeLock(5);
deviceConfiguration.setPasscodeMinutesOfInactivityBeforeScreenTimeout(14);
deviceConfiguration.setPasscodeMinimumCharacterSetCount(0);
deviceConfiguration.setPasscodePreviousPasscodeBlockCount(2);
deviceConfiguration.setPasscodeSignInFailureCountBeforeWipe(4);
deviceConfiguration.setPasscodeRequiredType(RequiredPasswordType.Alphanumeric);
deviceConfiguration.setPasscodeRequired(true);
deviceConfiguration.setPodcastsBlocked(true);
deviceConfiguration.setSafariBlockAutofill(true);
deviceConfiguration.setSafariBlockJavaScript(true);
deviceConfiguration.setSafariBlockPopups(true);
deviceConfiguration.setSafariBlocked(true);
deviceConfiguration.setSafariCookieSettings(WebBrowserCookieSettings.BlockAlways);
LinkedList<String> safariManagedDomains = new LinkedList<String>();
safariManagedDomains.add("Safari Managed Domains value");
deviceConfiguration.setSafariManagedDomains(safariManagedDomains);
LinkedList<String> safariPasswordAutoFillDomains = new LinkedList<String>();
safariPasswordAutoFillDomains.add("Safari Password Auto Fill Domains value");
deviceConfiguration.setSafariPasswordAutoFillDomains(safariPasswordAutoFillDomains);
deviceConfiguration.setSafariRequireFraudWarning(true);
deviceConfiguration.setScreenCaptureBlocked(true);
deviceConfiguration.setSiriBlocked(true);
deviceConfiguration.setSiriBlockedWhenLocked(true);
deviceConfiguration.setSiriBlockUserGeneratedContent(true);
deviceConfiguration.setSiriRequireProfanityFilter(true);
deviceConfiguration.setSpotlightBlockInternetResults(true);
deviceConfiguration.setVoiceDialingBlocked(true);
deviceConfiguration.setWallpaperBlockModification(true);
deviceConfiguration.setWiFiConnectOnlyToConfiguredNetworks(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.iosGeneralDeviceConfiguration',
description: 'Description value',
displayName: 'Display Name value',
version: 7,
accountBlockModification: true,
activationLockAllowWhenSupervised: true,
airDropBlocked: true,
airDropForceUnmanagedDropTarget: true,
airPlayForcePairingPasswordForOutgoingRequests: true,
appleWatchBlockPairing: true,
appleWatchForceWristDetection: true,
appleNewsBlocked: true,
appsSingleAppModeList: [
{
'@odata.type': 'microsoft.graph.appListItem',
name: 'Name value',
publisher: 'Publisher value',
appStoreUrl: 'https://example.com/appStoreUrl/',
appId: 'App Id value'
}
],
appsVisibilityList: [
{
'@odata.type': 'microsoft.graph.appListItem',
name: 'Name value',
publisher: 'Publisher value',
appStoreUrl: 'https://example.com/appStoreUrl/',
appId: 'App Id value'
}
],
appsVisibilityListType: 'appsInListCompliant',
appStoreBlockAutomaticDownloads: true,
appStoreBlocked: true,
appStoreBlockInAppPurchases: true,
appStoreBlockUIAppInstallation: true,
appStoreRequirePassword: true,
bluetoothBlockModification: true,
cameraBlocked: true,
cellularBlockDataRoaming: true,
cellularBlockGlobalBackgroundFetchWhileRoaming: true,
cellularBlockPerAppDataModification: true,
cellularBlockPersonalHotspot: true,
cellularBlockVoiceRoaming: true,
certificatesBlockUntrustedTlsCertificates: true,
classroomAppBlockRemoteScreenObservation: true,
classroomAppForceUnpromptedScreenObservation: true,
compliantAppsList: [
{
'@odata.type': 'microsoft.graph.appListItem',
name: 'Name value',
publisher: 'Publisher value',
appStoreUrl: 'https://example.com/appStoreUrl/',
appId: 'App Id value'
}
],
compliantAppListType: 'appsInListCompliant',
configurationProfileBlockChanges: true,
definitionLookupBlocked: true,
deviceBlockEnableRestrictions: true,
deviceBlockEraseContentAndSettings: true,
deviceBlockNameModification: true,
diagnosticDataBlockSubmission: true,
diagnosticDataBlockSubmissionModification: true,
documentsBlockManagedDocumentsInUnmanagedApps: true,
documentsBlockUnmanagedDocumentsInManagedApps: true,
emailInDomainSuffixes: [
'Email In Domain Suffixes value'
],
enterpriseAppBlockTrust: true,
enterpriseAppBlockTrustModification: true,
faceTimeBlocked: true,
findMyFriendsBlocked: true,
gamingBlockGameCenterFriends: true,
gamingBlockMultiplayer: true,
gameCenterBlocked: true,
hostPairingBlocked: true,
iBooksStoreBlocked: true,
iBooksStoreBlockErotica: true,
iCloudBlockActivityContinuation: true,
iCloudBlockBackup: true,
iCloudBlockDocumentSync: true,
iCloudBlockManagedAppsSync: true,
iCloudBlockPhotoLibrary: true,
iCloudBlockPhotoStreamSync: true,
iCloudBlockSharedPhotoStream: true,
iCloudRequireEncryptedBackup: true,
iTunesBlockExplicitContent: true,
iTunesBlockMusicService: true,
iTunesBlockRadio: true,
keyboardBlockAutoCorrect: true,
keyboardBlockDictation: true,
keyboardBlockPredictive: true,
keyboardBlockShortcuts: true,
keyboardBlockSpellCheck: true,
kioskModeAllowAssistiveSpeak: true,
kioskModeAllowAssistiveTouchSettings: true,
kioskModeAllowAutoLock: true,
kioskModeAllowColorInversionSettings: true,
kioskModeAllowRingerSwitch: true,
kioskModeAllowScreenRotation: true,
kioskModeAllowSleepButton: true,
kioskModeAllowTouchscreen: true,
kioskModeAllowVoiceOverSettings: true,
kioskModeAllowVolumeButtons: true,
kioskModeAllowZoomSettings: true,
kioskModeAppStoreUrl: 'https://example.com/kioskModeAppStoreUrl/',
kioskModeBuiltInAppId: 'Kiosk Mode Built In App Id value',
kioskModeRequireAssistiveTouch: true,
kioskModeRequireColorInversion: true,
kioskModeRequireMonoAudio: true,
kioskModeRequireVoiceOver: true,
kioskModeRequireZoom: true,
kioskModeManagedAppId: 'Kiosk Mode Managed App Id value',
lockScreenBlockControlCenter: true,
lockScreenBlockNotificationView: true,
lockScreenBlockPassbook: true,
lockScreenBlockTodayView: true,
mediaContentRatingAustralia: {
'@odata.type': 'microsoft.graph.mediaContentRatingAustralia',
movieRating: 'allBlocked',
tvRating: 'allBlocked'
},
mediaContentRatingCanada: {
'@odata.type': 'microsoft.graph.mediaContentRatingCanada',
movieRating: 'allBlocked',
tvRating: 'allBlocked'
},
mediaContentRatingFrance: {
'@odata.type': 'microsoft.graph.mediaContentRatingFrance',
movieRating: 'allBlocked',
tvRating: 'allBlocked'
},
mediaContentRatingGermany: {
'@odata.type': 'microsoft.graph.mediaContentRatingGermany',
movieRating: 'allBlocked',
tvRating: 'allBlocked'
},
mediaContentRatingIreland: {
'@odata.type': 'microsoft.graph.mediaContentRatingIreland',
movieRating: 'allBlocked',
tvRating: 'allBlocked'
},
mediaContentRatingJapan: {
'@odata.type': 'microsoft.graph.mediaContentRatingJapan',
movieRating: 'allBlocked',
tvRating: 'allBlocked'
},
mediaContentRatingNewZealand: {
'@odata.type': 'microsoft.graph.mediaContentRatingNewZealand',
movieRating: 'allBlocked',
tvRating: 'allBlocked'
},
mediaContentRatingUnitedKingdom: {
'@odata.type': 'microsoft.graph.mediaContentRatingUnitedKingdom',
movieRating: 'allBlocked',
tvRating: 'allBlocked'
},
mediaContentRatingUnitedStates: {
'@odata.type': 'microsoft.graph.mediaContentRatingUnitedStates',
movieRating: 'allBlocked',
tvRating: 'allBlocked'
},
networkUsageRules: [
{
'@odata.type': 'microsoft.graph.iosNetworkUsageRule',
managedApps: [
{
'@odata.type': 'microsoft.graph.appListItem',
name: 'Name value',
publisher: 'Publisher value',
appStoreUrl: 'https://example.com/appStoreUrl/',
appId: 'App Id value'
}
],
cellularDataBlockWhenRoaming: true,
cellularDataBlocked: true
}
],
mediaContentRatingApps: 'allBlocked',
messagesBlocked: true,
notificationsBlockSettingsModification: true,
passcodeBlockFingerprintUnlock: true,
passcodeBlockFingerprintModification: true,
passcodeBlockModification: true,
passcodeBlockSimple: true,
passcodeExpirationDays: 6,
passcodeMinimumLength: 5,
passcodeMinutesOfInactivityBeforeLock: 5,
passcodeMinutesOfInactivityBeforeScreenTimeout: 14,
passcodeMinimumCharacterSetCount: 0,
passcodePreviousPasscodeBlockCount: 2,
passcodeSignInFailureCountBeforeWipe: 4,
passcodeRequiredType: 'alphanumeric',
passcodeRequired: true,
podcastsBlocked: true,
safariBlockAutofill: true,
safariBlockJavaScript: true,
safariBlockPopups: true,
safariBlocked: true,
safariCookieSettings: 'blockAlways',
safariManagedDomains: [
'Safari Managed Domains value'
],
safariPasswordAutoFillDomains: [
'Safari Password Auto Fill Domains value'
],
safariRequireFraudWarning: true,
screenCaptureBlocked: true,
siriBlocked: true,
siriBlockedWhenLocked: true,
siriBlockUserGeneratedContent: true,
siriRequireProfanityFilter: true,
spotlightBlockInternetResults: true,
voiceDialingBlocked: true,
wallpaperBlockModification: true,
wiFiConnectOnlyToConfiguredNetworks: 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\IosGeneralDeviceConfiguration;
use Microsoft\Graph\Generated\Models\AppListItem;
use Microsoft\Graph\Generated\Models\AppListType;
use Microsoft\Graph\Generated\Models\MediaContentRatingAustralia;
use Microsoft\Graph\Generated\Models\RatingAustraliaMoviesType;
use Microsoft\Graph\Generated\Models\RatingAustraliaTelevisionType;
use Microsoft\Graph\Generated\Models\MediaContentRatingCanada;
use Microsoft\Graph\Generated\Models\RatingCanadaMoviesType;
use Microsoft\Graph\Generated\Models\RatingCanadaTelevisionType;
use Microsoft\Graph\Generated\Models\MediaContentRatingFrance;
use Microsoft\Graph\Generated\Models\RatingFranceMoviesType;
use Microsoft\Graph\Generated\Models\RatingFranceTelevisionType;
use Microsoft\Graph\Generated\Models\MediaContentRatingGermany;
use Microsoft\Graph\Generated\Models\RatingGermanyMoviesType;
use Microsoft\Graph\Generated\Models\RatingGermanyTelevisionType;
use Microsoft\Graph\Generated\Models\MediaContentRatingIreland;
use Microsoft\Graph\Generated\Models\RatingIrelandMoviesType;
use Microsoft\Graph\Generated\Models\RatingIrelandTelevisionType;
use Microsoft\Graph\Generated\Models\MediaContentRatingJapan;
use Microsoft\Graph\Generated\Models\RatingJapanMoviesType;
use Microsoft\Graph\Generated\Models\RatingJapanTelevisionType;
use Microsoft\Graph\Generated\Models\MediaContentRatingNewZealand;
use Microsoft\Graph\Generated\Models\RatingNewZealandMoviesType;
use Microsoft\Graph\Generated\Models\RatingNewZealandTelevisionType;
use Microsoft\Graph\Generated\Models\MediaContentRatingUnitedKingdom;
use Microsoft\Graph\Generated\Models\RatingUnitedKingdomMoviesType;
use Microsoft\Graph\Generated\Models\RatingUnitedKingdomTelevisionType;
use Microsoft\Graph\Generated\Models\MediaContentRatingUnitedStates;
use Microsoft\Graph\Generated\Models\RatingUnitedStatesMoviesType;
use Microsoft\Graph\Generated\Models\RatingUnitedStatesTelevisionType;
use Microsoft\Graph\Generated\Models\IosNetworkUsageRule;
use Microsoft\Graph\Generated\Models\RatingAppsType;
use Microsoft\Graph\Generated\Models\RequiredPasswordType;
use Microsoft\Graph\Generated\Models\WebBrowserCookieSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new IosGeneralDeviceConfiguration();
$requestBody->setOdataType('#microsoft.graph.iosGeneralDeviceConfiguration');
$requestBody->setDescription('Description value');
$requestBody->setDisplayName('Display Name value');
$requestBody->setVersion(7);
$requestBody->setAccountBlockModification(true);
$requestBody->setActivationLockAllowWhenSupervised(true);
$requestBody->setAirDropBlocked(true);
$requestBody->setAirDropForceUnmanagedDropTarget(true);
$requestBody->setAirPlayForcePairingPasswordForOutgoingRequests(true);
$requestBody->setAppleWatchBlockPairing(true);
$requestBody->setAppleWatchForceWristDetection(true);
$requestBody->setAppleNewsBlocked(true);
$appsSingleAppModeListAppListItem1 = new AppListItem();
$appsSingleAppModeListAppListItem1->setOdataType('microsoft.graph.appListItem');
$appsSingleAppModeListAppListItem1->setName('Name value');
$appsSingleAppModeListAppListItem1->setPublisher('Publisher value');
$appsSingleAppModeListAppListItem1->setAppStoreUrl('https://example.com/appStoreUrl/');
$appsSingleAppModeListAppListItem1->setAppId('App Id value');
$appsSingleAppModeListArray []= $appsSingleAppModeListAppListItem1;
$requestBody->setAppsSingleAppModeList($appsSingleAppModeListArray);
$appsVisibilityListAppListItem1 = new AppListItem();
$appsVisibilityListAppListItem1->setOdataType('microsoft.graph.appListItem');
$appsVisibilityListAppListItem1->setName('Name value');
$appsVisibilityListAppListItem1->setPublisher('Publisher value');
$appsVisibilityListAppListItem1->setAppStoreUrl('https://example.com/appStoreUrl/');
$appsVisibilityListAppListItem1->setAppId('App Id value');
$appsVisibilityListArray []= $appsVisibilityListAppListItem1;
$requestBody->setAppsVisibilityList($appsVisibilityListArray);
$requestBody->setAppsVisibilityListType(new AppListType('appsInListCompliant'));
$requestBody->setAppStoreBlockAutomaticDownloads(true);
$requestBody->setAppStoreBlocked(true);
$requestBody->setAppStoreBlockInAppPurchases(true);
$requestBody->setAppStoreBlockUIAppInstallation(true);
$requestBody->setAppStoreRequirePassword(true);
$requestBody->setBluetoothBlockModification(true);
$requestBody->setCameraBlocked(true);
$requestBody->setCellularBlockDataRoaming(true);
$requestBody->setCellularBlockGlobalBackgroundFetchWhileRoaming(true);
$requestBody->setCellularBlockPerAppDataModification(true);
$requestBody->setCellularBlockPersonalHotspot(true);
$requestBody->setCellularBlockVoiceRoaming(true);
$requestBody->setCertificatesBlockUntrustedTlsCertificates(true);
$requestBody->setClassroomAppBlockRemoteScreenObservation(true);
$requestBody->setClassroomAppForceUnpromptedScreenObservation(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->setConfigurationProfileBlockChanges(true);
$requestBody->setDefinitionLookupBlocked(true);
$requestBody->setDeviceBlockEnableRestrictions(true);
$requestBody->setDeviceBlockEraseContentAndSettings(true);
$requestBody->setDeviceBlockNameModification(true);
$requestBody->setDiagnosticDataBlockSubmission(true);
$requestBody->setDiagnosticDataBlockSubmissionModification(true);
$requestBody->setDocumentsBlockManagedDocumentsInUnmanagedApps(true);
$requestBody->setDocumentsBlockUnmanagedDocumentsInManagedApps(true);
$requestBody->setEmailInDomainSuffixes(['Email In Domain Suffixes value', ]);
$requestBody->setEnterpriseAppBlockTrust(true);
$requestBody->setEnterpriseAppBlockTrustModification(true);
$requestBody->setFaceTimeBlocked(true);
$requestBody->setFindMyFriendsBlocked(true);
$requestBody->setGamingBlockGameCenterFriends(true);
$requestBody->setGamingBlockMultiplayer(true);
$requestBody->setGameCenterBlocked(true);
$requestBody->setHostPairingBlocked(true);
$requestBody->setIBooksStoreBlocked(true);
$requestBody->setIBooksStoreBlockErotica(true);
$requestBody->setICloudBlockActivityContinuation(true);
$requestBody->setICloudBlockBackup(true);
$requestBody->setICloudBlockDocumentSync(true);
$requestBody->setICloudBlockManagedAppsSync(true);
$requestBody->setICloudBlockPhotoLibrary(true);
$requestBody->setICloudBlockPhotoStreamSync(true);
$requestBody->setICloudBlockSharedPhotoStream(true);
$requestBody->setICloudRequireEncryptedBackup(true);
$requestBody->setITunesBlockExplicitContent(true);
$requestBody->setITunesBlockMusicService(true);
$requestBody->setITunesBlockRadio(true);
$requestBody->setKeyboardBlockAutoCorrect(true);
$requestBody->setKeyboardBlockDictation(true);
$requestBody->setKeyboardBlockPredictive(true);
$requestBody->setKeyboardBlockShortcuts(true);
$requestBody->setKeyboardBlockSpellCheck(true);
$requestBody->setKioskModeAllowAssistiveSpeak(true);
$requestBody->setKioskModeAllowAssistiveTouchSettings(true);
$requestBody->setKioskModeAllowAutoLock(true);
$requestBody->setKioskModeAllowColorInversionSettings(true);
$requestBody->setKioskModeAllowRingerSwitch(true);
$requestBody->setKioskModeAllowScreenRotation(true);
$requestBody->setKioskModeAllowSleepButton(true);
$requestBody->setKioskModeAllowTouchscreen(true);
$requestBody->setKioskModeAllowVoiceOverSettings(true);
$requestBody->setKioskModeAllowVolumeButtons(true);
$requestBody->setKioskModeAllowZoomSettings(true);
$requestBody->setKioskModeAppStoreUrl('https://example.com/kioskModeAppStoreUrl/');
$requestBody->setKioskModeBuiltInAppId('Kiosk Mode Built In App Id value');
$requestBody->setKioskModeRequireAssistiveTouch(true);
$requestBody->setKioskModeRequireColorInversion(true);
$requestBody->setKioskModeRequireMonoAudio(true);
$requestBody->setKioskModeRequireVoiceOver(true);
$requestBody->setKioskModeRequireZoom(true);
$requestBody->setKioskModeManagedAppId('Kiosk Mode Managed App Id value');
$requestBody->setLockScreenBlockControlCenter(true);
$requestBody->setLockScreenBlockNotificationView(true);
$requestBody->setLockScreenBlockPassbook(true);
$requestBody->setLockScreenBlockTodayView(true);
$mediaContentRatingAustralia = new MediaContentRatingAustralia();
$mediaContentRatingAustralia->setOdataType('microsoft.graph.mediaContentRatingAustralia');
$mediaContentRatingAustralia->setMovieRating(new RatingAustraliaMoviesType('allBlocked'));
$mediaContentRatingAustralia->setTvRating(new RatingAustraliaTelevisionType('allBlocked'));
$requestBody->setMediaContentRatingAustralia($mediaContentRatingAustralia);
$mediaContentRatingCanada = new MediaContentRatingCanada();
$mediaContentRatingCanada->setOdataType('microsoft.graph.mediaContentRatingCanada');
$mediaContentRatingCanada->setMovieRating(new RatingCanadaMoviesType('allBlocked'));
$mediaContentRatingCanada->setTvRating(new RatingCanadaTelevisionType('allBlocked'));
$requestBody->setMediaContentRatingCanada($mediaContentRatingCanada);
$mediaContentRatingFrance = new MediaContentRatingFrance();
$mediaContentRatingFrance->setOdataType('microsoft.graph.mediaContentRatingFrance');
$mediaContentRatingFrance->setMovieRating(new RatingFranceMoviesType('allBlocked'));
$mediaContentRatingFrance->setTvRating(new RatingFranceTelevisionType('allBlocked'));
$requestBody->setMediaContentRatingFrance($mediaContentRatingFrance);
$mediaContentRatingGermany = new MediaContentRatingGermany();
$mediaContentRatingGermany->setOdataType('microsoft.graph.mediaContentRatingGermany');
$mediaContentRatingGermany->setMovieRating(new RatingGermanyMoviesType('allBlocked'));
$mediaContentRatingGermany->setTvRating(new RatingGermanyTelevisionType('allBlocked'));
$requestBody->setMediaContentRatingGermany($mediaContentRatingGermany);
$mediaContentRatingIreland = new MediaContentRatingIreland();
$mediaContentRatingIreland->setOdataType('microsoft.graph.mediaContentRatingIreland');
$mediaContentRatingIreland->setMovieRating(new RatingIrelandMoviesType('allBlocked'));
$mediaContentRatingIreland->setTvRating(new RatingIrelandTelevisionType('allBlocked'));
$requestBody->setMediaContentRatingIreland($mediaContentRatingIreland);
$mediaContentRatingJapan = new MediaContentRatingJapan();
$mediaContentRatingJapan->setOdataType('microsoft.graph.mediaContentRatingJapan');
$mediaContentRatingJapan->setMovieRating(new RatingJapanMoviesType('allBlocked'));
$mediaContentRatingJapan->setTvRating(new RatingJapanTelevisionType('allBlocked'));
$requestBody->setMediaContentRatingJapan($mediaContentRatingJapan);
$mediaContentRatingNewZealand = new MediaContentRatingNewZealand();
$mediaContentRatingNewZealand->setOdataType('microsoft.graph.mediaContentRatingNewZealand');
$mediaContentRatingNewZealand->setMovieRating(new RatingNewZealandMoviesType('allBlocked'));
$mediaContentRatingNewZealand->setTvRating(new RatingNewZealandTelevisionType('allBlocked'));
$requestBody->setMediaContentRatingNewZealand($mediaContentRatingNewZealand);
$mediaContentRatingUnitedKingdom = new MediaContentRatingUnitedKingdom();
$mediaContentRatingUnitedKingdom->setOdataType('microsoft.graph.mediaContentRatingUnitedKingdom');
$mediaContentRatingUnitedKingdom->setMovieRating(new RatingUnitedKingdomMoviesType('allBlocked'));
$mediaContentRatingUnitedKingdom->setTvRating(new RatingUnitedKingdomTelevisionType('allBlocked'));
$requestBody->setMediaContentRatingUnitedKingdom($mediaContentRatingUnitedKingdom);
$mediaContentRatingUnitedStates = new MediaContentRatingUnitedStates();
$mediaContentRatingUnitedStates->setOdataType('microsoft.graph.mediaContentRatingUnitedStates');
$mediaContentRatingUnitedStates->setMovieRating(new RatingUnitedStatesMoviesType('allBlocked'));
$mediaContentRatingUnitedStates->setTvRating(new RatingUnitedStatesTelevisionType('allBlocked'));
$requestBody->setMediaContentRatingUnitedStates($mediaContentRatingUnitedStates);
$networkUsageRulesIosNetworkUsageRule1 = new IosNetworkUsageRule();
$networkUsageRulesIosNetworkUsageRule1->setOdataType('microsoft.graph.iosNetworkUsageRule');
$managedAppsAppListItem1 = new AppListItem();
$managedAppsAppListItem1->setOdataType('microsoft.graph.appListItem');
$managedAppsAppListItem1->setName('Name value');
$managedAppsAppListItem1->setPublisher('Publisher value');
$managedAppsAppListItem1->setAppStoreUrl('https://example.com/appStoreUrl/');
$managedAppsAppListItem1->setAppId('App Id value');
$managedAppsArray []= $managedAppsAppListItem1;
$networkUsageRulesIosNetworkUsageRule1->setManagedApps($managedAppsArray);
$networkUsageRulesIosNetworkUsageRule1->setCellularDataBlockWhenRoaming(true);
$networkUsageRulesIosNetworkUsageRule1->setCellularDataBlocked(true);
$networkUsageRulesArray []= $networkUsageRulesIosNetworkUsageRule1;
$requestBody->setNetworkUsageRules($networkUsageRulesArray);
$requestBody->setMediaContentRatingApps(new RatingAppsType('allBlocked'));
$requestBody->setMessagesBlocked(true);
$requestBody->setNotificationsBlockSettingsModification(true);
$requestBody->setPasscodeBlockFingerprintUnlock(true);
$requestBody->setPasscodeBlockFingerprintModification(true);
$requestBody->setPasscodeBlockModification(true);
$requestBody->setPasscodeBlockSimple(true);
$requestBody->setPasscodeExpirationDays(6);
$requestBody->setPasscodeMinimumLength(5);
$requestBody->setPasscodeMinutesOfInactivityBeforeLock(5);
$requestBody->setPasscodeMinutesOfInactivityBeforeScreenTimeout(14);
$requestBody->setPasscodeMinimumCharacterSetCount(0);
$requestBody->setPasscodePreviousPasscodeBlockCount(2);
$requestBody->setPasscodeSignInFailureCountBeforeWipe(4);
$requestBody->setPasscodeRequiredType(new RequiredPasswordType('alphanumeric'));
$requestBody->setPasscodeRequired(true);
$requestBody->setPodcastsBlocked(true);
$requestBody->setSafariBlockAutofill(true);
$requestBody->setSafariBlockJavaScript(true);
$requestBody->setSafariBlockPopups(true);
$requestBody->setSafariBlocked(true);
$requestBody->setSafariCookieSettings(new WebBrowserCookieSettings('blockAlways'));
$requestBody->setSafariManagedDomains(['Safari Managed Domains value', ]);
$requestBody->setSafariPasswordAutoFillDomains(['Safari Password Auto Fill Domains value', ]);
$requestBody->setSafariRequireFraudWarning(true);
$requestBody->setScreenCaptureBlocked(true);
$requestBody->setSiriBlocked(true);
$requestBody->setSiriBlockedWhenLocked(true);
$requestBody->setSiriBlockUserGeneratedContent(true);
$requestBody->setSiriRequireProfanityFilter(true);
$requestBody->setSpotlightBlockInternetResults(true);
$requestBody->setVoiceDialingBlocked(true);
$requestBody->setWallpaperBlockModification(true);
$requestBody->setWiFiConnectOnlyToConfiguredNetworks(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.iosGeneralDeviceConfiguration"
description = "Description value"
displayName = "Display Name value"
version = 7
accountBlockModification = $true
activationLockAllowWhenSupervised = $true
airDropBlocked = $true
airDropForceUnmanagedDropTarget = $true
airPlayForcePairingPasswordForOutgoingRequests = $true
appleWatchBlockPairing = $true
appleWatchForceWristDetection = $true
appleNewsBlocked = $true
appsSingleAppModeList = @(
@{
"@odata.type" = "microsoft.graph.appListItem"
name = "Name value"
publisher = "Publisher value"
appStoreUrl = "https://example.com/appStoreUrl/"
appId = "App Id value"
}
)
appsVisibilityList = @(
@{
"@odata.type" = "microsoft.graph.appListItem"
name = "Name value"
publisher = "Publisher value"
appStoreUrl = "https://example.com/appStoreUrl/"
appId = "App Id value"
}
)
appsVisibilityListType = "appsInListCompliant"
appStoreBlockAutomaticDownloads = $true
appStoreBlocked = $true
appStoreBlockInAppPurchases = $true
appStoreBlockUIAppInstallation = $true
appStoreRequirePassword = $true
bluetoothBlockModification = $true
cameraBlocked = $true
cellularBlockDataRoaming = $true
cellularBlockGlobalBackgroundFetchWhileRoaming = $true
cellularBlockPerAppDataModification = $true
cellularBlockPersonalHotspot = $true
cellularBlockVoiceRoaming = $true
certificatesBlockUntrustedTlsCertificates = $true
classroomAppBlockRemoteScreenObservation = $true
classroomAppForceUnpromptedScreenObservation = $true
compliantAppsList = @(
@{
"@odata.type" = "microsoft.graph.appListItem"
name = "Name value"
publisher = "Publisher value"
appStoreUrl = "https://example.com/appStoreUrl/"
appId = "App Id value"
}
)
compliantAppListType = "appsInListCompliant"
configurationProfileBlockChanges = $true
definitionLookupBlocked = $true
deviceBlockEnableRestrictions = $true
deviceBlockEraseContentAndSettings = $true
deviceBlockNameModification = $true
diagnosticDataBlockSubmission = $true
diagnosticDataBlockSubmissionModification = $true
documentsBlockManagedDocumentsInUnmanagedApps = $true
documentsBlockUnmanagedDocumentsInManagedApps = $true
emailInDomainSuffixes = @(
"Email In Domain Suffixes value"
)
enterpriseAppBlockTrust = $true
enterpriseAppBlockTrustModification = $true
faceTimeBlocked = $true
findMyFriendsBlocked = $true
gamingBlockGameCenterFriends = $true
gamingBlockMultiplayer = $true
gameCenterBlocked = $true
hostPairingBlocked = $true
iBooksStoreBlocked = $true
iBooksStoreBlockErotica = $true
iCloudBlockActivityContinuation = $true
iCloudBlockBackup = $true
iCloudBlockDocumentSync = $true
iCloudBlockManagedAppsSync = $true
iCloudBlockPhotoLibrary = $true
iCloudBlockPhotoStreamSync = $true
iCloudBlockSharedPhotoStream = $true
iCloudRequireEncryptedBackup = $true
iTunesBlockExplicitContent = $true
iTunesBlockMusicService = $true
iTunesBlockRadio = $true
keyboardBlockAutoCorrect = $true
keyboardBlockDictation = $true
keyboardBlockPredictive = $true
keyboardBlockShortcuts = $true
keyboardBlockSpellCheck = $true
kioskModeAllowAssistiveSpeak = $true
kioskModeAllowAssistiveTouchSettings = $true
kioskModeAllowAutoLock = $true
kioskModeAllowColorInversionSettings = $true
kioskModeAllowRingerSwitch = $true
kioskModeAllowScreenRotation = $true
kioskModeAllowSleepButton = $true
kioskModeAllowTouchscreen = $true
kioskModeAllowVoiceOverSettings = $true
kioskModeAllowVolumeButtons = $true
kioskModeAllowZoomSettings = $true
kioskModeAppStoreUrl = "https://example.com/kioskModeAppStoreUrl/"
kioskModeBuiltInAppId = "Kiosk Mode Built In App Id value"
kioskModeRequireAssistiveTouch = $true
kioskModeRequireColorInversion = $true
kioskModeRequireMonoAudio = $true
kioskModeRequireVoiceOver = $true
kioskModeRequireZoom = $true
kioskModeManagedAppId = "Kiosk Mode Managed App Id value"
lockScreenBlockControlCenter = $true
lockScreenBlockNotificationView = $true
lockScreenBlockPassbook = $true
lockScreenBlockTodayView = $true
mediaContentRatingAustralia = @{
"@odata.type" = "microsoft.graph.mediaContentRatingAustralia"
movieRating = "allBlocked"
tvRating = "allBlocked"
}
mediaContentRatingCanada = @{
"@odata.type" = "microsoft.graph.mediaContentRatingCanada"
movieRating = "allBlocked"
tvRating = "allBlocked"
}
mediaContentRatingFrance = @{
"@odata.type" = "microsoft.graph.mediaContentRatingFrance"
movieRating = "allBlocked"
tvRating = "allBlocked"
}
mediaContentRatingGermany = @{
"@odata.type" = "microsoft.graph.mediaContentRatingGermany"
movieRating = "allBlocked"
tvRating = "allBlocked"
}
mediaContentRatingIreland = @{
"@odata.type" = "microsoft.graph.mediaContentRatingIreland"
movieRating = "allBlocked"
tvRating = "allBlocked"
}
mediaContentRatingJapan = @{
"@odata.type" = "microsoft.graph.mediaContentRatingJapan"
movieRating = "allBlocked"
tvRating = "allBlocked"
}
mediaContentRatingNewZealand = @{
"@odata.type" = "microsoft.graph.mediaContentRatingNewZealand"
movieRating = "allBlocked"
tvRating = "allBlocked"
}
mediaContentRatingUnitedKingdom = @{
"@odata.type" = "microsoft.graph.mediaContentRatingUnitedKingdom"
movieRating = "allBlocked"
tvRating = "allBlocked"
}
mediaContentRatingUnitedStates = @{
"@odata.type" = "microsoft.graph.mediaContentRatingUnitedStates"
movieRating = "allBlocked"
tvRating = "allBlocked"
}
networkUsageRules = @(
@{
"@odata.type" = "microsoft.graph.iosNetworkUsageRule"
managedApps = @(
@{
"@odata.type" = "microsoft.graph.appListItem"
name = "Name value"
publisher = "Publisher value"
appStoreUrl = "https://example.com/appStoreUrl/"
appId = "App Id value"
}
)
cellularDataBlockWhenRoaming = $true
cellularDataBlocked = $true
}
)
mediaContentRatingApps = "allBlocked"
messagesBlocked = $true
notificationsBlockSettingsModification = $true
passcodeBlockFingerprintUnlock = $true
passcodeBlockFingerprintModification = $true
passcodeBlockModification = $true
passcodeBlockSimple = $true
passcodeExpirationDays =
passcodeMinimumLength =
passcodeMinutesOfInactivityBeforeLock =
passcodeMinutesOfInactivityBeforeScreenTimeout =
passcodeMinimumCharacterSetCount =
passcodePreviousPasscodeBlockCount =
passcodeSignInFailureCountBeforeWipe =
passcodeRequiredType = "alphanumeric"
passcodeRequired = $true
podcastsBlocked = $true
safariBlockAutofill = $true
safariBlockJavaScript = $true
safariBlockPopups = $true
safariBlocked = $true
safariCookieSettings = "blockAlways"
safariManagedDomains = @(
"Safari Managed Domains value"
)
safariPasswordAutoFillDomains = @(
"Safari Password Auto Fill Domains value"
)
safariRequireFraudWarning = $true
screenCaptureBlocked = $true
siriBlocked = $true
siriBlockedWhenLocked = $true
siriBlockUserGeneratedContent = $true
siriRequireProfanityFilter = $true
spotlightBlockInternetResults = $true
voiceDialingBlocked = $true
wallpaperBlockModification = $true
wiFiConnectOnlyToConfiguredNetworks = $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.ios_general_device_configuration import IosGeneralDeviceConfiguration
from msgraph.generated.models.app_list_item import AppListItem
from msgraph.generated.models.app_list_type import AppListType
from msgraph.generated.models.media_content_rating_australia import MediaContentRatingAustralia
from msgraph.generated.models.rating_australia_movies_type import RatingAustraliaMoviesType
from msgraph.generated.models.rating_australia_television_type import RatingAustraliaTelevisionType
from msgraph.generated.models.media_content_rating_canada import MediaContentRatingCanada
from msgraph.generated.models.rating_canada_movies_type import RatingCanadaMoviesType
from msgraph.generated.models.rating_canada_television_type import RatingCanadaTelevisionType
from msgraph.generated.models.media_content_rating_france import MediaContentRatingFrance
from msgraph.generated.models.rating_france_movies_type import RatingFranceMoviesType
from msgraph.generated.models.rating_france_television_type import RatingFranceTelevisionType
from msgraph.generated.models.media_content_rating_germany import MediaContentRatingGermany
from msgraph.generated.models.rating_germany_movies_type import RatingGermanyMoviesType
from msgraph.generated.models.rating_germany_television_type import RatingGermanyTelevisionType
from msgraph.generated.models.media_content_rating_ireland import MediaContentRatingIreland
from msgraph.generated.models.rating_ireland_movies_type import RatingIrelandMoviesType
from msgraph.generated.models.rating_ireland_television_type import RatingIrelandTelevisionType
from msgraph.generated.models.media_content_rating_japan import MediaContentRatingJapan
from msgraph.generated.models.rating_japan_movies_type import RatingJapanMoviesType
from msgraph.generated.models.rating_japan_television_type import RatingJapanTelevisionType
from msgraph.generated.models.media_content_rating_new_zealand import MediaContentRatingNewZealand
from msgraph.generated.models.rating_new_zealand_movies_type import RatingNewZealandMoviesType
from msgraph.generated.models.rating_new_zealand_television_type import RatingNewZealandTelevisionType
from msgraph.generated.models.media_content_rating_united_kingdom import MediaContentRatingUnitedKingdom
from msgraph.generated.models.rating_united_kingdom_movies_type import RatingUnitedKingdomMoviesType
from msgraph.generated.models.rating_united_kingdom_television_type import RatingUnitedKingdomTelevisionType
from msgraph.generated.models.media_content_rating_united_states import MediaContentRatingUnitedStates
from msgraph.generated.models.rating_united_states_movies_type import RatingUnitedStatesMoviesType
from msgraph.generated.models.rating_united_states_television_type import RatingUnitedStatesTelevisionType
from msgraph.generated.models.ios_network_usage_rule import IosNetworkUsageRule
from msgraph.generated.models.rating_apps_type import RatingAppsType
from msgraph.generated.models.required_password_type import RequiredPasswordType
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 = IosGeneralDeviceConfiguration(
odata_type = "#microsoft.graph.iosGeneralDeviceConfiguration",
description = "Description value",
display_name = "Display Name value",
version = 7,
account_block_modification = True,
activation_lock_allow_when_supervised = True,
air_drop_blocked = True,
air_drop_force_unmanaged_drop_target = True,
air_play_force_pairing_password_for_outgoing_requests = True,
apple_watch_block_pairing = True,
apple_watch_force_wrist_detection = True,
apple_news_blocked = True,
apps_single_app_mode_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_visibility_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_visibility_list_type = AppListType.AppsInListCompliant,
app_store_block_automatic_downloads = True,
app_store_blocked = True,
app_store_block_in_app_purchases = True,
app_store_block_u_i_app_installation = True,
app_store_require_password = True,
bluetooth_block_modification = True,
camera_blocked = True,
cellular_block_data_roaming = True,
cellular_block_global_background_fetch_while_roaming = True,
cellular_block_per_app_data_modification = True,
cellular_block_personal_hotspot = True,
cellular_block_voice_roaming = True,
certificates_block_untrusted_tls_certificates = True,
classroom_app_block_remote_screen_observation = True,
classroom_app_force_unprompted_screen_observation = 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,
configuration_profile_block_changes = True,
definition_lookup_blocked = True,
device_block_enable_restrictions = True,
device_block_erase_content_and_settings = True,
device_block_name_modification = True,
diagnostic_data_block_submission = True,
diagnostic_data_block_submission_modification = True,
documents_block_managed_documents_in_unmanaged_apps = True,
documents_block_unmanaged_documents_in_managed_apps = True,
email_in_domain_suffixes = [
"Email In Domain Suffixes value",
],
enterprise_app_block_trust = True,
enterprise_app_block_trust_modification = True,
face_time_blocked = True,
find_my_friends_blocked = True,
gaming_block_game_center_friends = True,
gaming_block_multiplayer = True,
game_center_blocked = True,
host_pairing_blocked = True,
i_books_store_blocked = True,
i_books_store_block_erotica = True,
i_cloud_block_activity_continuation = True,
i_cloud_block_backup = True,
i_cloud_block_document_sync = True,
i_cloud_block_managed_apps_sync = True,
i_cloud_block_photo_library = True,
i_cloud_block_photo_stream_sync = True,
i_cloud_block_shared_photo_stream = True,
i_cloud_require_encrypted_backup = True,
i_tunes_block_explicit_content = True,
i_tunes_block_music_service = True,
i_tunes_block_radio = True,
keyboard_block_auto_correct = True,
keyboard_block_dictation = True,
keyboard_block_predictive = True,
keyboard_block_shortcuts = True,
keyboard_block_spell_check = True,
kiosk_mode_allow_assistive_speak = True,
kiosk_mode_allow_assistive_touch_settings = True,
kiosk_mode_allow_auto_lock = True,
kiosk_mode_allow_color_inversion_settings = True,
kiosk_mode_allow_ringer_switch = True,
kiosk_mode_allow_screen_rotation = True,
kiosk_mode_allow_sleep_button = True,
kiosk_mode_allow_touchscreen = True,
kiosk_mode_allow_voice_over_settings = True,
kiosk_mode_allow_volume_buttons = True,
kiosk_mode_allow_zoom_settings = True,
kiosk_mode_app_store_url = "https://example.com/kioskModeAppStoreUrl/",
kiosk_mode_built_in_app_id = "Kiosk Mode Built In App Id value",
kiosk_mode_require_assistive_touch = True,
kiosk_mode_require_color_inversion = True,
kiosk_mode_require_mono_audio = True,
kiosk_mode_require_voice_over = True,
kiosk_mode_require_zoom = True,
kiosk_mode_managed_app_id = "Kiosk Mode Managed App Id value",
lock_screen_block_control_center = True,
lock_screen_block_notification_view = True,
lock_screen_block_passbook = True,
lock_screen_block_today_view = True,
media_content_rating_australia = MediaContentRatingAustralia(
odata_type = "microsoft.graph.mediaContentRatingAustralia",
movie_rating = RatingAustraliaMoviesType.AllBlocked,
tv_rating = RatingAustraliaTelevisionType.AllBlocked,
),
media_content_rating_canada = MediaContentRatingCanada(
odata_type = "microsoft.graph.mediaContentRatingCanada",
movie_rating = RatingCanadaMoviesType.AllBlocked,
tv_rating = RatingCanadaTelevisionType.AllBlocked,
),
media_content_rating_france = MediaContentRatingFrance(
odata_type = "microsoft.graph.mediaContentRatingFrance",
movie_rating = RatingFranceMoviesType.AllBlocked,
tv_rating = RatingFranceTelevisionType.AllBlocked,
),
media_content_rating_germany = MediaContentRatingGermany(
odata_type = "microsoft.graph.mediaContentRatingGermany",
movie_rating = RatingGermanyMoviesType.AllBlocked,
tv_rating = RatingGermanyTelevisionType.AllBlocked,
),
media_content_rating_ireland = MediaContentRatingIreland(
odata_type = "microsoft.graph.mediaContentRatingIreland",
movie_rating = RatingIrelandMoviesType.AllBlocked,
tv_rating = RatingIrelandTelevisionType.AllBlocked,
),
media_content_rating_japan = MediaContentRatingJapan(
odata_type = "microsoft.graph.mediaContentRatingJapan",
movie_rating = RatingJapanMoviesType.AllBlocked,
tv_rating = RatingJapanTelevisionType.AllBlocked,
),
media_content_rating_new_zealand = MediaContentRatingNewZealand(
odata_type = "microsoft.graph.mediaContentRatingNewZealand",
movie_rating = RatingNewZealandMoviesType.AllBlocked,
tv_rating = RatingNewZealandTelevisionType.AllBlocked,
),
media_content_rating_united_kingdom = MediaContentRatingUnitedKingdom(
odata_type = "microsoft.graph.mediaContentRatingUnitedKingdom",
movie_rating = RatingUnitedKingdomMoviesType.AllBlocked,
tv_rating = RatingUnitedKingdomTelevisionType.AllBlocked,
),
media_content_rating_united_states = MediaContentRatingUnitedStates(
odata_type = "microsoft.graph.mediaContentRatingUnitedStates",
movie_rating = RatingUnitedStatesMoviesType.AllBlocked,
tv_rating = RatingUnitedStatesTelevisionType.AllBlocked,
),
network_usage_rules = [
IosNetworkUsageRule(
odata_type = "microsoft.graph.iosNetworkUsageRule",
managed_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",
),
],
cellular_data_block_when_roaming = True,
cellular_data_blocked = True,
),
],
media_content_rating_apps = RatingAppsType.AllBlocked,
messages_blocked = True,
notifications_block_settings_modification = True,
passcode_block_fingerprint_unlock = True,
passcode_block_fingerprint_modification = True,
passcode_block_modification = True,
passcode_block_simple = True,
passcode_expiration_days = 6,
passcode_minimum_length = 5,
passcode_minutes_of_inactivity_before_lock = 5,
passcode_minutes_of_inactivity_before_screen_timeout = 14,
passcode_minimum_character_set_count = 0,
passcode_previous_passcode_block_count = 2,
passcode_sign_in_failure_count_before_wipe = 4,
passcode_required_type = RequiredPasswordType.Alphanumeric,
passcode_required = True,
podcasts_blocked = True,
safari_block_autofill = True,
safari_block_java_script = True,
safari_block_popups = True,
safari_blocked = True,
safari_cookie_settings = WebBrowserCookieSettings.BlockAlways,
safari_managed_domains = [
"Safari Managed Domains value",
],
safari_password_auto_fill_domains = [
"Safari Password Auto Fill Domains value",
],
safari_require_fraud_warning = True,
screen_capture_blocked = True,
siri_blocked = True,
siri_blocked_when_locked = True,
siri_block_user_generated_content = True,
siri_require_profanity_filter = True,
spotlight_block_internet_results = True,
voice_dialing_blocked = True,
wallpaper_block_modification = True,
wi_fi_connect_only_to_configured_networks = 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.