Language:EN
Let's talk
← Back to insightsInsights

Disable anonymous enumeration of shares

Reading time: 2 min ·

Introduction

By default, Windows can allow unauthenticated users to obtain information about accounts and shared resources. Although this does not provide direct access, it makes reconnaissance of the environment easier and can help password and social engineering attacks.

To reduce this exposure, Microsoft recommends enabling the setting Network access: Do not allow anonymous enumeration of SAM accounts and shares, which in this article we will refer to as Disable Anonymous enumeration of shares.

You can find all the information about this setting in Microsoft's official documentation: Network access: Do not allow anonymous enumeration of SAM accounts and shares.

What is Disable Anonymous enumeration of shares?

Disable Anonymous enumeration of shares is a Microsoft security measure that prevents anonymous connections from enumerating accounts stored in the SAM (Security Accounts Manager) and network shares.

When the local security policy Network access: Do not allow anonymous enumeration of SAM accounts and shares is enabled, unauthenticated users can no longer query this information anonymously.

This setting reduces the information available during the reconnaissance phase, but it does not replace other security controls. It also does not prevent anonymous access to resources whose permissions explicitly include the ANONYMOUS LOGON group, so existing permissions must also be reviewed.

What are the risks without Disable Anonymous enumeration of shares?

If anonymous enumeration is allowed, an attacker can obtain account and share names without valid credentials.

This information can be used to:

  • Identify existing accounts and facilitate password attacks.
  • Learn the structure or role of certain systems.
  • Prepare more convincing social engineering attacks.
  • Carry out reconnaissance before attempting access.

How to configure Disable Anonymous enumeration of shares

Microsoft recommends enabling Network access: Do not allow anonymous enumeration of SAM accounts and shares. We can do this through:

GPO

  • Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options
  • Edit Network access: Do not allow anonymous enumeration of SAM accounts and shares and select Enabled.
Configuring Disable Anonymous enumeration of shares through GPO

Intune

  • Create a configuration policy for Windows and set:
  • Network access: Do not allow anonymous enumeration of SAM accounts and shares = Enabled.
Configuring Disable Anonymous enumeration of shares in Microsoft Intune

Registry

  • Path: HKLM\SYSTEM\CurrentControlSet\Control\Lsa
  • Value: RestrictAnonymousSAM
  • Type: DWORD
  • Data: 1
RestrictAnonymousSAM value set in the Windows Registry

No restart is required. Before rolling out the setting, we recommend testing it on a pilot group and checking that no legacy application or system depends on anonymous connections.

Shall we talk about your Microsoft environment?

Talk to a specialist →