Language:EN
Let's talk
← Back to insightsInsights

What is ms-DS-MachineAccountQuota and how do you configure it?

Reading time: 2 min ·

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.

Microsoft Defender for Identity security recommendation to set ms-DS-MachineAccountQuota to 0
Microsoft Defender dashboard showing an insecure domain configuration
Microsoft Defender for Identity recommends limiting 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
PowerShell command to query the value of ms-DS-MachineAccountQuota
Manually checking the value of 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 }
Set-ADDomain PowerShell command to change ms-DS-MachineAccountQuota to 0
Using PowerShell to set ms-DS-MachineAccountQuota to 0.

Option B: GUI (ADUC)

  1. Open "Active Directory Users and Computers" (Win + R → dsa.msc).
  2. Right-click your domain → Properties.
  3. Enable Advanced Features.
  4. In the Attribute Editor, find ms-DS-MachineAccountQuota and change its value to 0.
  5. Save the changes.
Active Directory Attribute Editor showing ms-DS-MachineAccountQuota set to 10
Default value of 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.

Shall we talk about your Microsoft environment?

Talk to a specialist →