ms-DS-MachineAccountQuota is an Active Directory attribute that, by default, allows every user to join up to 10 computers to the domain. This setting, considered insecure, makes it easy for malicious actors to enrol unauthorised devices and compromise your infrastructure.
Why is ms-DS-MachineAccountQuota a risk?
- Unmanaged access: an attacker can add their own computer without oversight.
- No protection: these devices fall outside corporate antivirus, EDR and GPOs.
- Back doors: paths open up to exfiltrate sensitive data from the domain or hybrid environments.
- Policy evasion: security policies (GPOs) are not applied.
How to identify an insecure configuration
1. With Microsoft Defender for Identity
Install the Microsoft Defender for Identity sensor on your on-premises domain controller. This component automatically detects insecure default values and offers mitigation recommendations.


ms-DS-MachineAccountQuota to 0 to strengthen domain security.2. With PowerShell
Run the following command:
Get-ADObject ((Get-ADDomain).distinguishedname) -Properties ms-DS-MachineAccountQuota

ms-DS-MachineAccountQuota with PowerShell.Mitigation: set ms-DS-MachineAccountQuota to "0"
Option A: PowerShell
Set-ADDomain -Identity "YourDomain.local" -Replace @{ 'ms-DS-MachineAccountQuota' = 0 }

ms-DS-MachineAccountQuota to 0.Option B: GUI (ADUC)
- Open "Active Directory Users and Computers" (Win + R →
dsa.msc). - Right-click your domain → Properties.
- Enable Advanced Features.
- In the Attribute Editor, find
ms-DS-MachineAccountQuotaand change its value to 0. - Save the changes.

ms-DS-MachineAccountQuota set to 10 in Active Directory.Additional recommendations
- Audit the attribute regularly.
- Integrate Microsoft Defender for Identity for real-time alerts.
- Document the changes.
Conclusion and call to action
Limiting ms-DS-MachineAccountQuota to 0 strengthens your domain against unauthorised enrolments and malicious devices. Combined with Microsoft Defender for Identity, you get proactive monitoring and a more robust defence.
About the author:
Kevin Maldonado, LinkedIn
Cybersecurity technician at Allbit Solutions, specialising in protecting Microsoft 365 environments and endpoints. He holds Microsoft certifications in identity and security administration (Identity and Access Administrator Associate, 2025; Azure Security Engineer Associate, 2024), among other credentials.

