Create a Custom ADMX Policy

If your MDM does not provide a method for running scripts, you may want to create a Custom ADMX Policy to apply registry settings to your Windows 10 devices for situations where there are not CSPs available.

There are some limitations to what registry settings you can apply via Custom ADMX Policy. Policies are not allowed to write to locations within the System, Software\Microsoft, and Software\Policies\Microsoft keys, except for the following locations (Note – the following locations are ALLOWED):

  • Software\Policies\Microsoft\Office\
  • Software\Microsoft\Office\
  • Software\Microsoft\Windows\CurrentVersion\Explorer\
  • Software\Microsoft\Internet Explorer\
  • software\policies\microsoft\shared tools\proofing tools\
  • software\policies\microsoft\imejp\
  • software\policies\microsoft\ime\shared\
  • software\policies\microsoft\shared tools\graphics filters\
  • software\policies\microsoft\windows\currentversion\explorer\
  • software\policies\microsoft\softwareprotectionplatform\
  • software\policies\microsoft\officesoftwareprotectionplatform\
  • software\policies\microsoft\windows\windows search\preferences\
  • software\policies\microsoft\exchange\
  • software\microsoft\shared tools\proofing tools\
  • software\microsoft\shared tools\graphics filters\
  • software\microsoft\windows\windows search\preferences\
  • software\microsoft\exchange\
  • software\policies\microsoft\vba\security\
  • software\microsoft\onedrive

You can also choose to use existing ADMX group policies that are available for software packages such as Google Chrome and Microsoft Office. I have used both. Just be sure to encode the policy before applying them.

Here is an example of a custom ADMX policy that I created in order to apply the following registry setting:

HKCU:\Control Panel\International\User Profile

HttpAcceptLanguageOptOut

This is the Custom ADMX Policy that must be pushed to your device first before applying the actual policy setting:

Note carefully that I didn’t both to edit anything that wasn’t 100% necessary. Most of you will probably want to pretty up the category and policy names so that it is prettier. I am more of a minimalist 🙂 or maybe just a little bit lazy!

The only thing that is really important is that you:

  1. Specify which registry location and key you need to set
  2. Specify whether it is a “User” policy or a “Machine” policy
  3. Make note of the Policy Name that you are going to need to reference when applying the policy

Now that I have my policy applied, I want to set the registry key value to “1” (aka enabled). The next step is to push the following policy to the device to actual add the registry key with the correct value:

If you navigate to the registry of the device, you will see the custom ADMX Policy in this location:

HKLM:\Software\Microsoft\PolicyManager\ADMXDefault

You will also see the applied policy, in this location:

HKLM:\Software\Microsoft\PolicyManager\Current

and, of course, the destination registry key that we intended to set is now successfully applied.

Here is a really good article with video about how Custom Policies are created and applied –> https://docs.microsoft.com/en-us/windows/client-management/mdm/win32-and-centennial-app-policy-configuration

I used the article to figure out how to do this the first time, but it was a pain so I hope that my example will be helpful to you if you are looking to create a custom policy for the first time.

Confirming that MDM Policies have been applied

It is really difficult to feel confident about the move from GPO to MDM Policy, when you don’t know how to confirm that a policy has been successfully applied. I can’t tell you how many times over the past two years, people have raised concerns that they can’t see our MDM policies in the Group Policy editor 🙂

This post is all about sharing what I’ve learned over the past two years about how to confirm that an MDM policy has been successfully applied using tools that are built into the Windows 10 client.

For the most part (there are some exceptions like Firewall and Applocker), there are three tools built into the Windows 10 client that you can use to confirm that an MDM policy has been applied:

  1. Event Viewer
  2. Registry Editor
  3. MDM Report

Using the Event Viewer

When you push a policy from the MDM of your choice, logs for the event are stored in the following log:

Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin

Using the Registry Editor

In order to use the registry editor to monitor the application of MDM policies, I first wanted to share a diagram that shows at a very high level how policies are processed.

MDM policies are processed by the OMA-DM client and ultimately the destination registry settings that are impacted by the application of MDM policies are identical (there are of course exceptions) to the destination registry settings for Group Policy.

The Intermediate Registry Setting for a policy can be found in the following location:

HKLM:\Software\Microsoft\PolicyManager\Current (tells you which policies have been applied, but not always the value for the policy that was applied)

and

HKLM:\Software\Microsoft\PolicyManager\Provider\<provider ID for your device-MDM relationship> (tells you which policies have been applied, and the value of the policy)

The Destination Registry Setting for ADMX policies can be found in the following location:

HKLM:\Software\Microsoft\PolicyManager\Default

RegKeyPathRedirect

RegValueNameRedirect

I have had the most luck identifying the Destination Registry Setting for non-ADMX policies by searching the internet, but in another post, I will share a list of non-ADMX destination registry setting locations that I have already identified.

The most important thing to remember is that your destination registry settings can be modified by user’s directly if they are Administrators or via GPO so if you don’t reapply MDM policies the actual value of the policy on your clients can drift. In our situation, we have chosen to leverage an API feature of our MDM which allows us to identify drift in the destination registry settings and reapply the MDM policy to remediate.

Using the Advanced Diagnostic Report

The MDM Report can also be used to verify that MDM settings have been applied. To use the MDM report on a device, perform the following steps:

  1. Search for Access work or school
  2. Click on the resource that ends with “MDM” then click Info
  3. Scroll down to the bottom of the page
  4. Click Create Report
  5. Click Export
  6. The report can be retrieved from C:\Users\Public\Documents\MDM Diagnostics

I hope that you found this post useful. Feel free to comment or message me if you have any additional questions or if you have additional information that you would like to share on this topic.

My CSP Playlist

Photo by Pixabay on Pexels.com

I worked really, really hard to learn to play the piano accompaniment at mass. It took me a whole year to be able to play the entire mass. I started by playing just 1 song for each mass because 1 song was all that I was comfortable learning and then playing within a single week. Thankfully, the music director was extremely supportive; she would play the rest of the songs each week to make this scenario possible. I doubt that there are very many music directors out there that would be willing to do that.

Over time, I became comfortable learning and playing 2 songs in a week; then finally 3 songs. Eventually, I was able to play 4 songs in a week not because I could learn 4 songs in a week, but rather it was because I already knew 1 of the songs. Over time, I knew so many songs that I could play the whole mass each week!

That same music director suggested to me that I could earn extra money playing wedding and funeral masses if I had a playlist that I could provide to people of songs that I could play. I never did monetize my piano skills, but I did create the playlist that she suggested. By the time that I stopped playing at mass, I had more than 100 songs in my playlist 🙂

This is a long-winded way of telling you where this playlist concept came from and how it applies to Microsoft CSPs. I’m not sure what people out there want to know about how to successfully apply the policies, so I figured that if I posted my playlist, then people could send me a note or comment and tell me which policies they are having issues with so that I can share my experience on how to successfully apply them.

It is probably obvious from my posts so far that I strongly perfer using custom XML to configure Windows 10 devices because of the level of control that you have over the application and removal of each individual setting.

That said, here is my Playlist – please do let me know which ones you are having trouble with!! I will include links to any posts that I have written on these topics.

Every CSP I Have Ever Used

Custom ADMX Policies

AboveLock\AllowCortanaAboveLock

AboveLock\AllowToasts

Accounts\AllowAddingNonMicrosoftAccountsManually

Accounts\AllowMicrosoftAccountConnection

Accounts\Domain

Accounts\Users

ApplicationManagement\AllowAllTrustedApps

ApplicationManagement\AllowDeveloperUnlock

ApplicationManagement\AllowGameDVR

ApplicationManagement\MSIAllowUserControlOverInstall

Applocker\ApplicationLaunchRestrictions

AppRuntime\AllowMicrosoftAccountsToBeOptional

Autoplay\DisallowAutoplayForNonVolumeDevices

Autoplay\SetDefaultAutoRunBehavior

Autoplay\TurnOffAutoPlay

Bitlocker\EncryptionMethodByDriveType

Browser\AllowPasswordManager

Browser\AllowPopups

Browser\ConfigureHomeButton

Browser\ConfigureOpenMicrosoftEdgeWith

Browser\DisableLockdownOfStartPages

Browser\EnterpriseModeSiteList

Browser\HomePages

Browser\PreventCertErrorOverrides

Browser\PreventFirstRunPage

Browser\SetHomeButtonURL

Browser\SyncFavoritesBetweenIEAndMicrosoftEdge

Connectivity\DisableDownloadingOfPrintDriversOverHTTP

Connectivity\DisableInternetDownloadForWebPublishingAndOnlineOrderingWizards

Connectivity\HardenedUNCPaths

ControlPolicyConflict\MDMWinsOverGP

CredentialProviders\BlockPicturePassword

CredentialsDelegation\RemoteHostAllowsDelegationOfNonExportableCredentials

CredentialsUI\EnumerateAdministrators

DataProtection\AllowAzureRMSForEDP

DataProtection\AllowDirectMemoryAccess

DataProtection\EDPShowIcons

DataProtection\RevokeOnMDMHandoff

DataProtection\RevokeOnUnenroll

DeliveryOptimization\DODownloadMode

DeviceGuard\ConfigureSystemGuardLaunch

DeviceGuard\EnableVirtualizationBasedSecurity

DeviceGuard\LsaCfgFlags

DeviceGuard\RequirePlatformSecurityFeatures

DeviceLock\AllowSimpleDevicePassword

DeviceLock\AlphanumericDevicePasswordRequired

DeviceLock\DevicePasswordEnabled

DeviceLock\DevicePasswordExpiration

DeviceLock\DevicePasswordHistory

DeviceLock\MaxDevicePasswordFailedAttempts

DeviceLock\MaxInactivityTimeDeviceLock

DeviceLock\MinDevicePasswordComplexCharacters

DeviceLock\MinDevicePasswordLength

DeviceLock\MinimumPasswordAge

DeviceLock\PreventLockScreenSlideShow

EventLogService\SpecifyMaximumFileSizeApplicationLog

EventLogService\SpecifyMaximumFileSizeSecurityLog

EventLogService\SpecifyMaximumFileSizeSystemLog

Experience\AllowManualMDMUnenrollment

Experience\AllowWindowsConsumerFeatures

Experience\AllowThirdPartySuggestionsInWindowsSpotlight

FileExplorer\TurnOffDataExecutionPreventionForExplorer

FileExplorer\TurnOffHeapTerminationOnCorruption

Firewall

InternetExplorer\AllowAddonlist

InternetExplorer\AllowAutoComplete

InternetExplorer\AllowEnterpriseModeSiteList

InternetExplorer\AllowSiteToZoneAssignmentList

InternetExplorer\CheckServerCertificateRevocation

InternetExplorer\DisableFirstRunWizard

InternetExplorer\DisableHomePageChange

InternetExplorer\DisableSecondaryHomePageChange

InternetExplorer\DoNotAllowUsersToAddSites

InternetExplorer\DoNotAllowUsersToChangePolicies

InternetExplorer\DoNotBlockOutdatedActiveXControls

InternetExplorer\IncludeAllLocalSites

InternetExplorer\IncludeAllNetworkPaths

InternetExplorer\InternetZoneAllowAccessToDataSources

InternetExplorer\InternetZoneAllowAutomaticPromptingForActiveXControls

InternetExplorer\InternetZoneAllowAutomaticPromptingForFileDownloads

InternetExplorer\InternetZoneAllowCopyPasteViaScript

InternetExplorer\InternetZoneAllowDragAndDropCopyAndPasteFiles

InternetExplorer\InternetZoneAllowFontDownloads

InternetExplorer\InternetZoneAllowLessPrivilegedSites

InternetExplorer\InternetZoneAllowScriptInitiatedWindows

InternetExplorer\InternetZoneAllowUserDataPersistence

InternetExplorer\InternetZoneDownloadSignedActiveXControls

InternetExplorer\InternetZoneDownloadUnsignedActiveXControls

InternetExplorer\InternetZoneEnableMIMESniffing

InternetExplorer\InternetZoneInitializeAndScriptActiveXControls

InternetExplorer\InternetZoneJavaPermissions

InternetExplorer\InternetZoneLaunchingApplicationsAndFilesInIFRAME

InternetExplorer\InternetZoneLogonOptions

InternetExplorer\InternetZoneNavigateWindowsAndFrames

InternetExplorer\InternetZoneRunNETFrameworkReliantComponentsSignedWithAuthenticode

InternetExplorer\InternetZoneUsePopupBlocker

InternetExplorer\IntranetZoneJavaPermissions

InternetExplorer\TrustedSitesZoneAllowAccessToDataSources

InternetExplorer\TrustedSitesZoneAllowAutomaticPromptingForActiveXControls

InternetExplorer\TrustedSitesZoneAllowFontDownloads

InternetExplorer\TrustedSitesZoneAllowNETFrameworkReliantComponents

InternetExplorer\TrustedSitesZoneJavaPermissions

InternetExplorer\TrustedSitesZoneNavigateWindowsAndFrames

LanmanWorkstation\EnableInsecureGuestLogons

LocalPoliciesSecurityOptions\Accounts_BlockMicrosoftAccounts

LocalPoliciesSecurityOptions\Accounts_EnableAdministratorAccountStatus

LocalPoliciesSecurityOptions\Accounts_EnableGuestAccountStatus

LocalPoliciesSecurityOptions\Accounts\LimitLocalAccountUseOfBlankPasswordsToConsoleLogonOnly

LocalPoliciesSecurityOptions\Accounts_RenameAdministratorAccount

LocalPoliciesSecurityOptions\InteractiveLogon_DoNotDisplayLastSignedIn

LocalPoliciesSecurityOptions\InteractiveLogon_DoNotRequireCTRLALTDEL

LocalPoliciesSecurityOptions\InteractiveLogon_MachineInactivityLimit

LocalPoliciesSecurityOptions\InteractiveLogon_MessageTextForUsersAttemptingToLogOn

LocalPoliciesSecurityOptions\InteractiveLogon_MessageTitleForUsersAttemptingToLogOn

LocalPoliciesSecurityOptions\MicrosoftNetworkClient_DigitallySignCommunicationsAlways

LocalPoliciesSecurityOptions\MicrosoftNetworkClient_SendUnencryptedPasswordToThirdPartySMBServers

LocalPoliciesSecurityOptions\MicrosoftNetworkServer_DigitallySignCommunicationsAlways

LocalPoliciesSecurityOptions\NetworkAccess_DoNotAllowAnonymousEnumerationOfSAMAccounts

LocalPoliciesSecurityOptions\NetworkAccess_DoNotAllowAnonymousEnumerationOfSamAccountsAndShares

LocalPoliciesSecurityOptions\NetworkAccess_RestrictAnonymousAccessToNamedPipesAndShares

LocalPoliciesSecurityOptions\NetworkAccess_RestrictClientsAllowedToMakeRemoteCallsToSAM

LocalPoliciesSecurityOptions\NetworkSecurity_DoNotStoreLANManagerHashValueOnNextPasswordChange

LocalPoliciesSecurityOptions\NetworkSecurity_LANManagerAuthenticationLevel

LocalPoliciesSecurityOptions\NetworkSecurity_MinimumSessionSecurityForNTLMSSPBasedClients

LocalPoliciesSecurityOptions\NetworkSecurity_MinimumSessionSecurityForNTLMSSPBasedServers

LocalPoliciesSecurityOptions\UserAccountControl_BehaviorOfTheElevationPromptForAdministrators

LocalPoliciesSecurityOptions\UserAccountControl_BehaviorOfTheElevationPromptForStandardUsers

LocalPoliciesSecurityOptions\UserAccountControl_RunAllAdministratorsInAdminApprovalMode

LocalPoliciesSecurityOptions\UserAccountControl_UseAdminApprovalMode

LocalPoliciesSecurityOptions\UserAccountControl_VirtualizeFileAndRegistryWriteFailuresToPerUserLocations

MSSecurityGuide\ApplyUACRestrictionsToLocalAccountsOnNetworkLogon

MSSecurityGuide\ConfigureSMBV1ClientDriver

MSSecurityGuide\ConfigureSMBV1Server

MSSecurityGuide\EnableStructuredExceptionHandlingOverwriteProtection

MSSecurityGuide\WDigestAuthentication

MSLegacy\AllowICMPRedirectsToOverrideOSPFGeneratedRoutes

MSLegacy\AllowTheComputerToIgnoreNetBIOSNameReleaseRequestsExceptFromWINSServers

MSLegacy\IPSourceRoutingProtectionLevel

MSLegacy\IPv6SourceRoutingProtectionLevel

NetworkProxy

Office

PassportForWork

Personalization\DesktopImageUrl

Power\AllowStandbyStatesWhenSleepingOnBattery

Power\RequirePasswordWhenComputerWakesOnBattery

Power\RequirePasswordWhenComputerWakesPluggedIn

Power\StandbyTimeoutOnBattery

Power\StandbyTimeoutPluggedIn

Printers\PublishPrinters

Reboot\Schedule

RemoteAssitance\SolicitedRemoteAssistance

RemoteDesktopServices\ClientConnectionEncryptionLevel

RemoteDesktopServices\DoNotAllowDriveRedirection

RemoteDesktopServices\DoNotAllowPasswordSaving

RemoteDesktopServices\PromptForPasswordUponConnection

RemoteDesktopServices\RequireSecureRPCCommunication

RemoteManagement\AllowBasicAuthentication_Client

RemoteManagement\AllowBasicAuthentication_Service

RemoteManagement\AllowUnencryptedTraffic_Client

RemoteManagement\AllowUnencryptedTraffic_Service

RemoteManagement\DisallowDigestAuthentication

RemoteManagement\DisallowStoringOfRunAsCredentials

RemoteProcedureCall\RestrictUnauthenticatedRPCClients

Restricted Groups

Search\AllowIndexingEncryptedStoresOrItems

Security\AllowAutomaticDeviceEncryptionForAzureADJoinedDevices

Settings\AllowAutoPlay

Settings\PageVisibilityList

Start\ImportEdgeAssets

Start\StartLayout

Storage\RemovableDiskDenyWriteAccess

System\AllowStorageCard

System\AllowTelemetry

Update\AllowAutoUpdate

Update\AllowMUUpdateService

Update\AutoRestartDeadlinePeriodInDays

Update\AutoRestartNotificationSchedule

Update\AutoRestartRequiredNotificationDismissal

Update\BranchReadinessLevel

Update\DeferFeatureUpdatesPeriodInDays

Update\DeferQualityUpdatesPeriodInDays

Update\EngagedRestartDeadline

Update\EngagedRestartSnoozeSchedule

Update\EngagedRestartTransitionSchedule

Update\PauseFeatureUpdates

Update\PauseQualityUpdates

Wifi\AllowAutoConnectToWiFiSenseHotspots

Wifi\AllowInternetSharin

WiFi\Profile

WindowsConnectionManager\PohitConnectionToNonDomainNetworksWhenConnectedToDomainAuthenticatedNetwork

WindowsDefenderSecurityCenter\DisableEnhancedNotifications

WindowsDefenderSecurityCenter\DisableNotifications

WindowsInkWorkspace\AllowWindowsInkWorkspace

WindowsLogon\HideFastUserSwitching

WindowsLogon\SignInLastInteractiveUserAutomaticallyAfterASystemInitiatedRestart

WindowsPowerShell\TurnOnPowerShellScriptBlockLogging

WiredNetwork\LanXML

Creating WlanXML

Assuming that you are using a Custom Policy, there are two steps to creating the XML to place within the <Data></Data> for the WiFi CSP WlanXML node:

  1. Export XML from an existing profile
  2. Encode the XML so that it can be processed by the OMA-DM client

Export XML from an existing profile

If you are migrating from Group Policy management to MDM management, then you probably already have a device configured with the needed WiFi profile that you can use to export the XML.

To export XML from an existing profile, perform the following steps from an existing GPO-managed device:

  1. Open Command Prompt
  2. Type netsh wlan export profile name=enter the name of the interface here

Encode the XML so that it can be processed by the OMA-DM client

  1. Open the exported XML with Notepad++ or the XML editor of your choice
  2. While there are a lot of fancier ways to handle the encoding, the simplest way is to do a replace all for the following three items –
    1. < is replaced with <
    2. > is replaced with >
    3. is replaced with

If you are using Custom XML, paste the resultant XML between the <Data></Data> and push the policy via the MDM of your choice.

In a separate post, I will share information about where to confirm that your policies have been applied.