How to get Azure RBAC deny assignments at the specified scope using PowerShell cmdlets.
Written by Titus Manohar, IT security team, ManageEngine Updated on November 2025
Description:
Executing this cmdlet lists all deny assignments based on role based access control (RBAC) that are effective at the specified scope. By default, the Get-AzDenyAssignment cmdlet returns all the deny assignments under a specific Azure subscription. To get required results, filtering parameters like principal, deny assignment name and scope can be used.
Syntax:
Example:
| Id | : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| DenyAssignmentName | : DA test 1 |
| Description | : Testing deny assignment using PowerShell cmdlets |
| Actions | : {foo/*} |
| NotActions | : {foo/*/read} |
| DataActions | : {foo/*} |
| NotDataActions | : {} |
| Scope | : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| DoNotApplyToChildScopes | : False |
| Principals | : { DisplayName: All Principals ObjectType: SystemDefined ObjectId: 00000000-0000-0000-0000-000000000000 } |
| ExcludePrincipals | : { DisplayName: testuser1 ObjectType: User ObjectId: f8d526a0-54eb-4941-ae69-ebf4a334d0f0 } |
| IsSystemProtected | : True |
| Id | : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| DenyAssignmentName | : DA test 2 |
| Description | : Testing deny assignment using PowerShell cmdlets |
| Actions | : {foo/*} |
| NotActions | : {foo/*/read} |
| DataActions | : {foo/*} |
| NotDataActions | : {} |
| Scope | : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/testRG |
| DoNotApplyToChildScopes | : False |
| Principals | : { DisplayName: testuser1 ObjectType: User ObjectId: f8d526a0-54eb-4941-ae69-ebf4a334d0f0 , DisplayName: TestingPowerShell ObjectType: ServicePrincipal ObjectId: f2dc21ac-702a-4bde-a4ce-146edf751d81 } |
| ExcludePrincipals | : {} |
| IsSystemProtected | : True |
In this example, the Get-AzDenyAssignment cmdlet lists all the deny assignments in the current subscription.
About ADAudit Plus
ADAudit Plus is a real time change auditing software that helps keep your Active Directory, Azure AD, Windows file servers, NetApp filers, EMC file systems, Synology file systems, Windows member servers, and workstations secure and compliant. With ADAudit Plus, you can get visibility into:
- Authorized and unauthorized AD management changes
- User logons, logoffs, and account lockouts
- GPO changes
- Group attribute and membership changes
- OU changes
- Privileged access and permission changes among other things.
There are more than 200 event-specific reports, and you can configure instant email alerts. You can also export the reports to XLS, HTML, PDF and CSV formats to assist in interpretation and forensics. For more information on ADAudit Plus, visit: https://www.manageengine.com/active-directory-audit/.
Explore Active Directory auditing and reporting with ADAudit Plus.
- Related Products
- ADManager Plus Active Directory Management & Reporting
- ADAudit Plus Real-time Active Directory Auditing and UBA
- EventLog Analyzer Real-time Log Analysis & Reporting
- ADSelfService Plus Self-Service Password Management
- AD360 Integrated Identity & Access Management
- Log360 (On-Premise | Cloud) Comprehensive SIEM and UEBA
- AD Free Tools Active Directory FREE Tools
