ManageEngine x Forrester | Workforce Identity Platforms Landscape Report

Active Directory Policies

How to deny anonymous enumeration of SAM accounts using GPO

For system administrators, safeguarding sensitive account information within the Windows environment is crucial. One important aspect of this is preventing the anonymous enumeration of Security Account Manager (SAM) accounts. Unauthorized enumeration of SAM accounts can be a significant security vulnerability, as it may allow attackers to gain information about user accounts and potentially exploit them. This article provides a detailed guide on creating a Group Policy Object (GPO) to deny anonymous enumeration of SAM accounts on computers running Windows.

Understanding SAM Account Enumeration

SAM accounts store user credentials and are critical components of Windows security. If an attacker can anonymously enumerate these accounts, they can gain valuable information, such as usernames, which can then be used in further attacks like brute-force attempts.


  • Administrative Rights: Administrative privileges in your Active Directory (AD) environment are required.
  • Group Policy Management Console (GPMC): This tool must be installed and accessible for configuring Group Policies.

Step-by-Step Instructions

Step 1: Open Group Policy Management Console

Launch GPMC by typing “Group Policy Management” in the Start menu search or by executing gpmc.msc.

Step 2: Create or Edit a Group Policy Object
  • To create a new GPO, right-click on the domain or an Organizational Unit (OU) and select “Create a GPO in this domain, and Link it here…”.
  • To modify an existing GPO, locate it under the appropriate domain or OU, right-click on it, and choose “Edit”.
Step 3: Navigate to Security Options

In the Group Policy Management Editor, navigate to: Computer ConfigurationPoliciesWindows SettingsSecurity SettingsLocal PoliciesSecurity Options.

Step 4: Configure Policies to Deny SAM Accounts Enumeration
  • Find the policy “Network access: Do not allow anonymous enumeration of SAM accounts”.
  • Set this policy to “Enabled”.
  • Enabling this policy will prevent anonymous users from obtaining a list of user accounts through network access, thereby protecting sensitive user information.
Step 5: Apply and Enforce the GPO
  • Click “OK” or “Apply” to save the changes.
  • Link the GPO to the appropriate OU(s).
  • The policy will be applied at the next Group Policy refresh cycle. To expedite, run gpupdate /force on the client machines.

Advanced Configuration and Use Cases

  1. High-Security Environments: In sectors like defense, finance, or healthcare, where data security is paramount, this policy is vital for protecting sensitive user information.
  2. Regulatory Compliance: Organizations subject to compliance requirements (e.g., HIPAA, GDPR) can use this policy to help meet standards related to protecting user data.
  3. Layered Security Strategy: Combine this policy with other security measures, like account lockout policies and strong password requirements, to strengthen overall security.

Security Considerations

  • Balancing Security and Accessibility: Ensure that the policy does not interfere with legitimate administrative activities. Administrators may need alternative methods to perform necessary user account enumerations securely.
  • Regular Policy Review: Periodically review the policy to ensure it aligns with current organizational needs and security standards.
  • User Training and Awareness: Educate users about security practices and the importance of protecting user account information.


  • Policy Not Applying: If the GPO does not seem to be taking effect, use tools like Resultant Set of Policy (RSoP) or gpresult to diagnose and troubleshoot.
  • Operational Challenges: In case legitimate administrative tasks are hindered, review the policy settings or provide specific accounts with necessary permissions.


Implementing a GPO to deny anonymous enumeration of SAM accounts is a critical step in securing sensitive user information on a Windows network. This guide provides system administrators with the necessary steps to effectively manage and safeguard user account data, enhancing the overall security posture of the organization.

Related posts
Active Directory Policies

Block windows app installation with elevated privileges using GPO

Active Directory Policies

GPO to prevent regular users from changing MSI installation options

Active Directory Policies

GPO to prevent autoplay on non-volume devices

Active Directory Policies

Prevent remote logon for local accounts with blank password - GPO


There are over 8,500 people who are getting towards perfection in Active Directory, IT Management & Cyber security through our insights from Identitude.

Wanna be a part of our bimonthly curation of IAM knowledge?

  • -Select-
  • By clicking 'Become an insider', you agree to processing of personal data according to the Privacy Policy.