How to Disable Machine Account Creation

Disabling Machine Account Creation
Since Windows 2000, Microsoft has enabled the ability for all users to create up to 10 machine accounts by default. This is a “feature” implemented by Microsoft that inadvertently introduces potential vulnerabilities within an Active Directory environment. Secure deployment should ensure that Machine Account creation is limited to specific users or groups; Lucid Security strongly recommends making this quick change to bolster your Active Directory environment’s security. This article demonstrates how to set the MachineAccountQuota to 0 instead of the default 10.
Dangers of User Machine Account Creation
First off, let me briefly highlight why having a MAQ of anything over “0” for users is a bad idea. First, once an attacker has valid user credentials, a machine account is trivial to add. This opens up attack paths for a threat actor that often lead to domain compromise. These include:
- Resource Based Constrained Delegation Attacks.
- Possibility of elevating computer account to domain admin via relaying attacks.
- Active Directory Certificate Services (AD CS) attacks.
- Additional persistence for an attacker should a user or administrator change existing user credentials.
How to Disable User Machine Account Creation
First, this is what it looks like from an attacker viewing the Machine Account Quota (MAQ) remotely from an attacker controlled device:

Second, this is what it looks like for an attacker creating a machine account:

Log into your domain controller and perform the following:
- Press Windows Key + R and type
adsiedit.msc
- Right click on the “DC=” drop down menu and select Properties
- Scroll down until you see ‘ms-DS-MachineAccountQuota’ and select it and then click Edit
- Modify the value to “0” and hit OK
- Apply



Assuming you’ve done everything correctly, this is what it will look like when a user checks the MAQ:

Lastly, when attempting to create a computer account, an attacker will be met with an error stating the relayed user machine quota is exceeded, or they do not have sufficient privileges:

Final Thoughts
Restricting the ability for users to create machine accounts is an important step in hardening an Active Directory environment and is often overlooked by IT administrators as it is an default value set by default by Microsoft. Lucid Security recommends having annual or bi-annual penetration testing to uncover settings such as this.
Contact us today at [email protected] or fill out our Contact Us form to speak with a qualified expert to determine the best solution for you!