Close Menu
Peter Klapwijk – In The Cloud 24-7Peter Klapwijk – In The Cloud 24-7
    Facebook X (Twitter) Instagram
    Peter Klapwijk – In The Cloud 24-7Peter Klapwijk – In The Cloud 24-7
    • Home
    • Intune
    • Windows
      • Modern Workplace
    • macOS
    • Android
    • iOS
    • Automation
      • Logic Apps
      • Intune Monitoring
      • GitHub
    • Security
      • Passwordless
      • Security
    • Speaking
    • About me
    Peter Klapwijk – In The Cloud 24-7Peter Klapwijk – In The Cloud 24-7
    Home»Intune»Disable Command prompt and registry access with Microsoft Intune
    Intune

    Disable Command prompt and registry access with Microsoft Intune

    Peter KlapwijkBy Peter KlapwijkOctober 1, 2020122 Mins Read

    As I wrote in a previous article Microsoft is adding more and more settings that are supported to be managed with Microsoft Intune. Two of these settings are available with the release of the Windows Insider build 20226;
    DisableCMD and DisableRegedit.

    With these two settings, we are able to block access to the Command Prompt and Registry Editor on Windows devices using Microsoft Intune.

    As I wrote in the previous article, to control these new settings we need to use a Custom configuration profile in Intune. If you are not familiar with these kind of profiles, please read my previous post first.

    The settings were already supported in build 20175 but Rudy Ooms and I found a bug related to these settings. After reporting this to Microsoft the bug which is fixed in the latest build.

    Create custom configuration profile

    Let`s create the custom configuration profile to block access to the CMD and regedit.

    • Sign-in to the Endpoint Manager admin center
    • Browse to Devices – Windows
    • Browse to Configuration profiles
    • Click +Create profile
    • Choose Windows 10 and later as Platform
    • Choose Custom as Profile
    • Click Create
    • Give the profile a Name
    • Enter a Description (Optional)
    • Click Next
    • Click Add on the Configuration settings tab
    • Give the Row a Name
    • Fill in the OMA-URI: ./user/vendor/MSFT/Policy/Config/ADMX_ShellCommandpromptRegeditTools/DisableRegedit
    • Data type: String
    • Value:
    <enabled/>
    <data id="DisableRegeditMode" value="2"/>
    • Click Save
    • Click Add
    • Give the Row a Name
    • Fill in the OMA-URI: ./user/vendor/MSFT/Policy/Config/ADMX_ShellCommandpromptRegeditTools/DisableCMD
    • Data type: String
    • Value:
    <enabled/>
    <data id="DisableCMDScripts" value="1"/>
    • Click Add

    The two settings are added to the profile, finish creating the profile by assigning the profile to a security group.

    End-user experience

    We can be short about the end-user experience.

    Access to the Command Prompt is blocked.

    And also access to the Registry Editor is blocked.

    This still allows access to both by running it as administrator.

    Thank you for reading.

    Intune MEM Microsoft Endpoint Manager Security Windows 10
    Share. Facebook Twitter LinkedIn Email WhatsApp
    Peter Klapwijk
    • Website
    • X (Twitter)
    • LinkedIn

    Peter is a Security (Intune) MVP since 2020 and is working as Modern Workplace Engineer at Wortell in The Netherlands. He has more than 15 years of experience in IT, with a strong focus on Microsoft technologies like Microsoft Intune, Windows, and (low-code) automation.

    Related Posts

    Manage Edge mobile favorites with Microsoft Intune

    November 25, 2020

    Manage the local administrators group with Microsoft Intune – Hybrid AAD joined Windows 10 devices

    April 13, 2020

    Restrict which users can logon into a Windows 10 device with Microsoft Intune

    April 11, 2020
    View 12 Comments

    12 Comments

    1. Troy Blake on October 2, 2020 01:24

      I like both of these settings and will enable then via Intune as soon as they are available. Great article!

      Reply
    2. Sathya Prakash on October 19, 2020 00:30

      Hi Peter Nice Blog
      Small query, if i block command prompt this way, will the Batch files deployed via INTUNE will also be blocked ?

      I read the full CSP of this new feature and i can see you can also block apps and the question is if i block powershell with this new CSP, will the powershell Win32 apps and script deployed via INTUNE will also be blocked ?

      Reply
      • Peter Klapwijk on October 24, 2020 08:46

        It should behave the same as using a GPO to block CMD. It should not block such a script.

        Reply
    3. James on October 28, 2020 14:47

      Will this work on Windows 10 Education? Not having much log deploying it.

      Reply
    4. JRS on November 5, 2020 10:06

      Hello, this is not applicable on Windows 10 enterprise version 2004 build 19041.546? I get the message below in Intune.

      ERROR CODE
      0x87d1fde8
      ERROR DETAILS
      Remediation failed

      Reply
      • Peter Klapwijk on November 6, 2020 08:28

        No this isn`t supported on 2004, the minimum Insider build is mentioned in the port.

        Reply
    5. Oemer on December 5, 2020 16:27

      i am getting error for windows 10 enterprise version 1909-18363.1198. OS version does not support this configuration?

      Reply
      • Peter Klapwijk on December 7, 2020 08:02

        That`s correct. The article starts with info what the minimum Windows build is on which it`s supported; Insider build 20226. 1909 is not supported.

        Reply
    6. Steven on April 28, 2021 16:27

      I there a way to make this work if I have a local account in Windows, that was created by Intune? The local account is a standard user, not and administrative user, and I wanting to disable the CMD Prompt, Reg Edit and GPEDIT and I have tried other OMA-URI’s like the two below, and can not get them to work in Windows 10 Educational Pro 20H2.

      ./Vendor/MSFT/Policy/Config/LocalPoliciesSecurityOptions

      ./user/vendor/MSFT/Policy/Config/ADMX_ShellCommandpromptRegeditTools

      Do I need to change the ./user/vendor to be ./user/Correct Account Name?

      Reply
    7. RG on May 1, 2021 01:05

      can you do the same for powershell? will it stop intune running sdcripts

      Reply
      • 3s on May 19, 2021 10:22

        I also want to know if you can do it for Powershell. Thanks

        Reply
    8. Arvindejit Saini on April 13, 2022 21:17

      The settings are applied successfully to a device group in Intune but now even me as admin can`t open it. When I use open/run as admin option it just gives me same msg that it`s disabled by Admin and same case is with Regedit.

      Reply
    Leave A Reply Cancel Reply

    Peter Klapwijk

    Hi! Welcome to my blog post.
    I hope you enjoy reading my articles.

    Hit the About Me button to get in contact with me or leave a comment.

    Awards
    Sponsor
    Latest Posts

    Create deployment ring groups for Microsoft Intune

    June 27, 2025

    Update Windows Defender during Windows Autopilot enrollments

    May 16, 2025

    Hide the “Turn on an ad privacy feature” pop-up in Chrome with Microsoft Intune

    April 19, 2025

    How to set Google as default search provider with Microsoft Intune

    April 18, 2025
    follow me
    • Twitter 4.8K
    • LinkedIn 6.1K
    • YouTube
    • Bluesky 1.5K
    Tags
    Administrative Templates Android Automation Autopilot Azure Azure AD Browser Conditional Access Edge EMS Exchange Online Feitian FIDO2 Flow Google Chrome Graph Graph API Identity Management Intune Intune Monitoring iOS KIOSK Logic Apps macOS MEM MEMMonitoring Microsoft 365 Microsoft Edge Microsoft Endpoint Manager Modern Workplace Office 365 OneDrive for Business Outlook Passwordless PowerApps Power Automate Security SharePoint Online Teams Windows Windows 10 Windows10 Windows 11 Windows Autopilot Windows Update
    Copy right

    This information is provided “AS IS” with no warranties, confers no rights and is not supported by the authors, or In The Cloud 24-7.

     

    Copyright © 2025 by In The Cloud 24-7/ Peter Klapwijk. All rights reserved, No part of the information on this web site may be reproduced or posted in any form or by any means without the prior written permission of the publisher.

    Shorthand; Don’t pass off my work as yours, it’s not nice.

    Recent Comments
    • Parth Savjadiya on Using Visual Studio with Microsoft Endpoint Privilege Management, some notes
    • Chris Johnson on Assign Deny Local Log On user right to an (Azure) AD group by using Microsoft Intune
    • Northernsky on Automatically wipe a Windows 10 device after a number of authentication failures
    • Henrik on Intune Driver update for Windows – Get applicable devices
    • Adam on Get notified on expiring Azure App Registration client secrets
    most popular

    Application installation issues; Download pending

    October 1, 2024

    Restrict which users can logon into a Windows 10 device with Microsoft Intune

    April 11, 2020

    How to change the Windows 11 language with Intune

    November 11, 2022

    Update Microsoft Edge during Windows Autopilot enrollments

    July 9, 2024
    Peter Klapwijk – In The Cloud 24-7
    X (Twitter) LinkedIn YouTube RSS Bluesky
    © 2025 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.

    Manage Cookie Consent
    To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
    Functional Always active
    The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
    Preferences
    The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
    Statistics
    The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
    Marketing
    The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
    Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
    View preferences
    {title} {title} {title}