How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune

In this blog post, I’ll be explaining how to configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Microsoft Endpoint Privilege Management (EPM) has introduced a new capability within elevation rules the Deny file elevation type. This enhancement allows administrators to explicitly block specific files from running with elevated privileges.

By adding Deny rules to your EPM configuration, you gain more control over which applications or scripts can escalate privileges, thus improving the security posture of your organization. While the primary purpose of EPM is to enable standard users to run specific trusted applications with elevated rights, Deny rules serve as an essential safeguard.

They ensure that potentially harmful or unauthorized files, including known malware or unapproved tools, are prevented from executing with elevated permissions, even if users attempt to do so. This feature strengthens your defense against privilege escalation attacks. Microsoft introduced EPM explicitly deny elevation from Service Release 2505 onwards.

Although Deny rules are a powerful addition, it is still recommended to focus primarily on allowing elevation for trusted and approved applications. Using a combination of allow and deny rules enables you to balance security with productivity, giving users the access they need without compromising endpoint integrity.

Patch My PC
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 1
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 1

EPM Rules Explicitly Deny Elevation Pre-requisites

Here is a table outlining the prerequisites for using Endpoint Privilege Management (EPM) rules that specifically deny elevation, utilizing the “Deny” file elevation type.

PrerequisiteDetails
Windows VersionWindows 10, version 21H2 (19044.3393 or later) with KB5030211 to Windows 11, version 24H2
Microsoft IntuneMicrosoft Intune Enrollment or Microsoft Configuration Manager co-managed devices (no workload requirements)
EPM LicensingRequires Microsoft Intune Suite license or the EPM add-on license for Microsoft Intune.
EPM Policy DeploymentEPM policies (including Deny rules) must be deployed via Endpoint Privilege Management settings in Intune.
File Hash or Path DetailsDeny rules must target a file via file hash, certificate, or file path. Accurate values are required for proper enforcement.
Device ScopeEnsure the target device group is properly assigned to the EPM policy containing Deny rules.
Policy ConfigurationA custom EPM elevation rule must be created with the action set to Deny and proper conditions (file path, hash, etc.) defined.
Device TypeMicrosoft Entra joined or Microsoft Entra hybrid joined
EPM Agent StatusDevices must have the EPM client component properly installed and running (Service Name : Microsoft EPM Agent Service). This can be monitored in the Intune admin center.
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Table. 1

Create an EPM Deny Elevation Rules Policy in Intune

To create an Endpoint Privilege Management Deny Elevation Rules Policy from scratch, start by signing in to the Microsoft Intune Admin Center with your administrator credentials.

  • Navigate to Endpoint Security > Endpoint Privilege Management > Choose Policies
  • Click on +Create policy
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 2
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 2

In the Create a profile window, select Platform as Windows and choose Profile as Elevation rules policy. An other option is the Elevation Settings Policy, which configures and enables the EPM service. For now, we will focus solely on the Elevation rules policy.

How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 3
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 3

On the Basics page, I will enter our policy name: HTMD – Deny EPM Elevation Rule Policy. If necessary, provide a brief description of the policy and then click Next.

How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 4
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 4

On the Configuration settings page, Elevation Rules define the conditions that allow users to gain just-in-time access to apps and files on their devices. By default, the Elevation type will show as “User Confirmed.” To change the settings, click the +Edit instance under the Configure settings option.

How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 5
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 5

Now, we will configure the Rule properties screen based on the Deny elevation type. Several options are mandatory. Please review the options below and select them accordingly. In this instance, I will be denying the VNC-Viewer application using the Elevation Rules policy.

Important Notes! To obtain the file hash, you must first install the EPM PowerShell module.
Import-Module "C:\Program Files\Microsoft EPM Agent\EpmTools\EpmCmdlets.dll"

To retrieve the File Attributes for the application binary, use the following PowerShell command line:
Get-FileAttributes -Filepath = "C:\Users\HTMDTestAccount\Downloads\VNC-Viewer-7.13.1-Windows.exe"
  • Rule name: VNC-Viewer Deny Rule
  • Elevation type: Deny
  • Child process behavior: Deny all
  • File name: VNC-Viewer-7.13.1-Windows.exe
  • Signature Source: Not configured
  • File hash: 7CB888C789083EAC23E16B061CEE49AEA14BBE14E7A784FB0FCA5CE0C23ED429
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 6
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 6

On the next page, keep the default scope tags. If you have any other custom scope tags available, you can select one according to your requirements.

How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 7
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 7

Click Next and assign the HTMD – Deny EPM Elevation Rule Policy to either a Device Group or a User Group, as both options are supported. In this example, I will be deploying it to a Device Group called HTMD – Test Computers. To do this, click Add groups under the Included Groups section, and then select the desired device group.

How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 8
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 8

On the Review + create pane, carefully check all the settings defined for the Deny EPM Elevation Rule Policy. Once you have confirmed everything is correct, select Create to implement the changes.

How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 9
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 9

Monitor the EPM Rule Explicitly Deny Elevation Deployment

The newly created EPM rule policy has been deployed to the Microsoft Entra ID group called HTMD – Test Computers. The policy will take effect as soon as the device has been synced. To monitor the status of the policy deployment, please follow the steps below in the Intune Portal.

  • Navigate to Endpoint SecurityUnder Manage > Endpoint Privilege Management > Policies

Search for the HTMD – Deny EPM Elevation Rule Policy. Click on it to view the policy’s Endpoint check-in status. Selecting View report allows you to explore the deployment, Device name, Logged in user, Check-in status, and more.

How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 10
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 10

End User Experience – EPM Rule Explicitly Deny Elevation

We need to verify if the Deny EPM Elevation Rule Policy is functioning properly. To do this, log in to one of the devices that the policy targets. In this example, I downloaded VNC-Viewer-7.13.1-Windows.exe and saved it in my Downloads folder. Next, I attempted to install it as a standard user (without admin rights). Please follow the steps outlined below.

  • Right-click on the VNC-Viewer-7.13.1-Windows.exe App binary and choose “Run with elevated access

You will likely encounter an error message stating, “You can’t run this app as an administrator“. “Your organization doesn’t allow you to run this app as administrator. Contact your support person for more information. Error code: 0x87E00207(-2015362553)”.

How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 11
How to Configure EPM Rule Explicitly Deny Elevation with Microsoft Intune. Fig. 11

Need Further Assistance or Have Technical Questions?

Join the LinkedIn Page and Telegram group to get the latest step-by-step guides and news updates. Join our Meetup Page to participate in User group meetings. Also, Join the WhatsApp Community to get the latest news on Microsoft Technologies. We are there on Reddit as well.

Author

Vaishnav K has over 11 years of experience in SCCM, Device Management, and Automation Solutions. Writes and imparts knowledge about Microsoft Intune, Azure, PowerShell scripting, and automation. Check out my profile on LinkedIn.

Leave a Comment