How to Check SMB Folder Enumeration Mode in Windows 11

    How to Check SMB Folder Enumeration Mode in Windows 11
    Learn how to check SMB folder enumeration mode in Windows 11 using PowerShell, compare AccessBased and Unrestricted settings, and troubleshoot network share visibility.

    SMB folder enumeration mode controls which files and folders users can see when they browse an SMB network share. This setting can be important for privacy, usability, and access control in Windows file-sharing environments.

    Windows provides a PowerShell property called FolderEnumerationMode for SMB shares. The two supported values are AccessBased and Unrestricted. With AccessBased, SMB does not display files and folders to a user unless that user has permission to access them. With Unrestricted, files and folders can be displayed even when the user does not have permission to open them.

    In this guide, you will learn how to check SMB folder enumeration mode in Windows 11 using PowerShell, inspect individual shares, check multiple shares, understand the difference between the two modes, change the setting when appropriate, and troubleshoot unexpected folder visibility.

    What Is SMB Folder Enumeration Mode?

    Folder enumeration is the process of displaying the files and folders contained inside a shared directory.

    For example, imagine an SMB share named Company containing these folders:

    • Accounting
    • Human Resources
    • Marketing
    • Projects
    • Public

    Without access-based enumeration, a user may be able to see all of these folder names even if the user cannot open some of them.

    With access-based enumeration enabled, SMB can hide files and folders from the directory listing when the user does not have the necessary permissions.

    This makes the folder structure less confusing and can reduce the amount of information exposed through directory browsing.

    What Is FolderEnumerationMode?

    FolderEnumerationMode is an SMB share property that determines how files and folders are presented to users browsing the share.

    Microsoft documents two available values:

    Mode Behavior
    AccessBased Users do not see files and folders for which they do not have access rights.
    Unrestricted Users can see files and folders even when they do not have permission to access them.

    Microsoft documents Unrestricted as the default value for new SMB shares.

    Why Check SMB Folder Enumeration Mode?

    Checking this property can help when users report that certain folders are visible or invisible on a network share.

    It can also help administrators understand whether a share is using access-based enumeration or unrestricted directory listing.

    • Check whether access-based enumeration is enabled.
    • Investigate unexpected folder visibility.
    • Understand why users see different directory listings.
    • Review SMB share security configuration.
    • Compare the configuration of multiple shares.
    • Document SMB share settings.
    • Troubleshoot network share browsing problems.

    Folder Visibility Is Not the Same as Permission

    One of the most important concepts is that folder visibility and folder access are not exactly the same thing.

    A user may be able to see the name of a folder but still receive an access-denied error when trying to open it.

    With AccessBased enumeration, the SMB server can hide objects that the user does not have permission to access from the directory listing.

    However, changing the enumeration mode does not replace SMB share permissions or NTFS permissions.

    For example, you should still check SMB share permissions with How to Check SMB Share Permissions in Windows 11 when a user cannot access a network share.

    How to Check SMB Folder Enumeration Mode

    The easiest way to check the setting for all visible SMB shares is with Get-SmbShare.

    Get-SmbShare |
        Select-Object Name, Path, FolderEnumerationMode

    A result may look like this:

    Name        Path                    FolderEnumerationMode
    ----        ----                    ---------------------
    Documents   C:\Shares\Documents     Unrestricted
    Projects    D:\Shares\Projects      AccessBased
    Public      D:\Shares\Public        Unrestricted

    The FolderEnumerationMode column tells you which mode is configured for each share.

    How to Check One SMB Share

    If you know the name of the SMB share, you can check it individually.

    Get-SmbShare -Name "Projects" |
        Select-Object Name, Path, FolderEnumerationMode

    For example:

    Name      Path                  FolderEnumerationMode
    ----      ----                  ---------------------
    Projects  D:\Shares\Projects    AccessBased

    This is useful when troubleshooting one particular share instead of reviewing every SMB share on the computer.

    How to View All SMB Share Properties

    Sometimes you need more information than just the folder enumeration mode.

    You can display all available properties for a specific SMB share:

    Get-SmbShare -Name "Projects" | Format-List *

    The output can include properties such as:

    • Name
    • Path
    • FolderEnumerationMode
    • CachingMode
    • LeasingMode
    • CATimeout
    • ContinuouslyAvailable
    • AvailabilityType
    • ShareState
    • CurrentUsers
    • EncryptData
    • ConcurrentUserLimit

    Microsoft's Get-SmbShare documentation demonstrates that FolderEnumerationMode is exposed as part of the SMB share object and can be retrieved alongside other share properties.

    How to Check Only Access-Based Shares

    If you manage many SMB shares, you can filter the results to show only shares using access-based enumeration.

    Get-SmbShare |
        Where-Object FolderEnumerationMode -eq "AccessBased" |
        Select-Object Name, Path, FolderEnumerationMode

    This makes it easier to identify shares where users should only see files and folders they have permission to access.

    How to Find Shares Using Unrestricted Enumeration

    You can perform the opposite check:

    Get-SmbShare |
        Where-Object FolderEnumerationMode -eq "Unrestricted" |
        Select-Object Name, Path, FolderEnumerationMode

    This can be useful during a security review because it shows shares where directory listings are not filtered by the user's access rights.

    Remember that Unrestricted does not mean that users automatically have permission to open everything they see. It only affects what is displayed during enumeration.

    AccessBased vs Unrestricted

    The difference becomes easier to understand with an example.

    Suppose an SMB share contains:

    \\FileServer\Company
        Accounting
        HR
        Marketing
        Public

    Assume a particular user has permission to access Marketing and Public, but not Accounting or HR.

    With Unrestricted

    The user may see all four folder names:

    Accounting
    HR
    Marketing
    Public

    The user can still be denied access when attempting to open folders for which the user lacks permission.

    With AccessBased

    The directory listing can show only the folders the user is allowed to access:

    Marketing
    Public

    This can make large departmental shares easier to navigate and can reduce unnecessary exposure of folder names.

    How to Check Folder Enumeration and SMB Permissions Together

    When troubleshooting visibility problems, check both the enumeration mode and the SMB share permissions.

    First check the enumeration mode:

    Get-SmbShare -Name "Company" |
        Select-Object Name, FolderEnumerationMode

    Then check the SMB share ACL:

    Get-SmbShareAccess -Name "Company"

    The second command retrieves the access control entries for the SMB share. Microsoft documents Get-SmbShareAccess as the PowerShell cmdlet for retrieving SMB share ACL information.

    You should also consider NTFS permissions on the underlying folder. SMB share permissions and NTFS permissions can both affect whether a user can actually access files and directories.

    How to Change SMB Folder Enumeration Mode

    If you have determined that a share should use access-based enumeration, you can modify the share with Set-SmbShare.

    Set-SmbShare -Name "Projects" -FolderEnumerationMode AccessBased

    To explicitly use unrestricted enumeration:

    Set-SmbShare -Name "Projects" -FolderEnumerationMode Unrestricted

    Microsoft documents both AccessBased and Unrestricted as valid values for the -FolderEnumerationMode parameter of Set-SmbShare.

    Because this changes the behavior of an SMB share, do not change the setting simply because a user reports that a folder is missing. First determine whether the current behavior is intentional.

    How to Verify the New Setting

    After changing the setting, verify the resulting configuration:

    Get-SmbShare -Name "Projects" |
        Select-Object Name, Path, FolderEnumerationMode

    For example:

    Name      Path                  FolderEnumerationMode
    ----      ----                  ---------------------
    Projects  D:\Shares\Projects    AccessBased

    You should also test the share from an appropriate client account to confirm that the directory listing behaves as expected.

    Check Multiple SMB Properties at Once

    Folder enumeration is only one part of an SMB share configuration. You can inspect several related properties together.

    Get-SmbShare |
        Select-Object Name,
        Path,
        FolderEnumerationMode,
        CachingMode,
        LeasingMode,
        ContinuouslyAvailable,
        CATimeout,
        EncryptData,
        CompressData

    This can provide a useful configuration overview.

    Property Purpose
    FolderEnumerationMode Controls which files and folders are displayed during enumeration.
    CachingMode Controls SMB Offline Files caching behavior.
    LeasingMode Controls SMB leasing and related caching behavior.
    ContinuouslyAvailable Indicates whether the share is configured for Continuous Availability.
    CATimeout Specifies the Continuous Availability timeout.
    EncryptData Indicates whether SMB share encryption is enabled.
    CompressData Indicates whether SMB compression is requested for the share.

    You can compare this with How to Check SMB Continuous Availability in Windows 11 and How to Check SMB Share Caching Mode in Windows 11.

    Folder Enumeration Mode and SMB Leasing Are Different

    It is important not to confuse folder enumeration with SMB leasing.

    FolderEnumerationMode determines which files and folders are displayed to users while browsing a share.

    LeasingMode is related to SMB leasing and client caching behavior.

    For example, a share can have:

    FolderEnumerationMode : AccessBased
    LeasingMode           : Full

    These two properties control different aspects of SMB behavior.

    For more information about leasing, see How to Check SMB Leasing in Windows 11.

    Folder Enumeration Mode and SMB Oplocks

    Oplocks are also separate from folder enumeration.

    SMB opportunistic locking is related to file caching and coordination between SMB clients and servers. Folder enumeration controls which objects are shown during directory browsing.

    Therefore, changing FolderEnumerationMode is not a way to disable or enable SMB oplocks.

    If your problem involves file caching, application locking, or performance, review How to Check SMB Opportunistic Locking (Oplocks) in Windows 11.

    How to Troubleshoot a Missing Folder

    If a user says that a folder has disappeared from an SMB share, work through the following checks.

    1. Check the SMB share name and network path.
    2. Check FolderEnumerationMode.
    3. Check SMB share permissions.
    4. Check NTFS permissions on the underlying folder.
    5. Test the same share using an administrator account when appropriate.
    6. Verify that the folder actually exists on the server.
    7. Check whether the user's account belongs to the expected security groups.
    8. Test the same share from another client.
    9. Check whether the behavior occurs only for one user.
    10. Review relevant Windows security and SMB events if necessary.

    A folder being invisible does not necessarily mean that it has been deleted. Access-based enumeration can intentionally remove inaccessible objects from the directory listing.

    Check the Underlying Folder

    If you suspect that the folder does not actually exist, inspect the SMB share's local path.

    Get-SmbShare -Name "Projects" |
        Select-Object Name, Path, FolderEnumerationMode

    Suppose the result shows:

    Name                  : Projects
    Path                  : D:\Shares\Projects
    FolderEnumerationMode : AccessBased

    You can then inspect the local directory:

    Get-ChildItem "D:\Shares\Projects"

    This helps distinguish a missing local folder from an SMB visibility or permissions problem.

    Check Active SMB Connections

    If the share is actively being used, you can inspect SMB client connections as part of a broader troubleshooting process.

    Get-SmbConnection |
        Select-Object ServerName, ShareName, UserName, Dialect, Encrypted

    This does not directly show why a particular folder is hidden, but it confirms information about active SMB connections.

    For a more detailed explanation, see How to Check SMB Connections in Windows 11.

    Check SMB Sessions and Open Files

    On the SMB server, you can also inspect active sessions:

    Get-SmbSession |
        Select-Object SessionId, ClientComputerName, ClientUserName, NumOpens

    Open files can be checked with:

    Get-SmbOpenFile |
        Select-Object ClientComputerName, ClientUserName, FileName, ShareRelativePath

    These commands are useful when a visibility problem is combined with an active file-sharing or file-locking problem.

    Check the SMB Share Configuration in Detail

    For a complete configuration review, use:

    Get-SmbShare -Name "Projects" | Format-List *

    This is particularly useful when investigating a clustered or advanced SMB environment because the share may have many properties related to availability, caching, encryption, compression, and user limits.

    For a broader server-side review, see How to Check SMB Server Configuration in Windows 11.

    Export SMB Folder Enumeration Settings

    If you manage several SMB shares, exporting the configuration can make auditing easier.

    Get-SmbShare |
        Select-Object Name, Path, FolderEnumerationMode |
        Export-Csv "$env:USERPROFILE\Desktop\smb-folder-enumeration.csv" -NoTypeInformation

    The resulting CSV file can be opened in Excel or another spreadsheet application for comparison and documentation.

    Useful PowerShell Commands

    Command Purpose
    Get-SmbShare Lists SMB shares.
    Get-SmbShare -Name "Projects" Checks a specific SMB share.
    Get-SmbShare | Select Name,FolderEnumerationMode Displays enumeration mode for shares.
    Get-SmbShare | Where FolderEnumerationMode -eq "AccessBased" Finds access-based shares.
    Set-SmbShare -Name "Projects" -FolderEnumerationMode AccessBased Enables access-based enumeration.
    Set-SmbShare -Name "Projects" -FolderEnumerationMode Unrestricted Uses unrestricted enumeration.
    Get-SmbShareAccess Checks SMB share permissions.
    Get-SmbConnection Checks active SMB connections.

    Frequently Asked Questions

    What is FolderEnumerationMode in Windows 11?

    FolderEnumerationMode is an SMB share property that controls which files and folders are displayed to users when they browse the share.

    What is AccessBased SMB enumeration?

    AccessBased enumeration prevents SMB from displaying files and folders to a user when that user does not have the necessary rights to access them.

    What is Unrestricted SMB enumeration?

    Unrestricted enumeration allows files and folders to be displayed even when the user does not have permission to access those items.

    Does AccessBased enumeration grant permissions?

    No. Access-based enumeration does not grant access. It controls visibility during enumeration. SMB share and NTFS permissions still determine whether the user can actually access the files and folders.

    Can I check FolderEnumerationMode with PowerShell?

    Yes. Use:

    Get-SmbShare |
        Select-Object Name, Path, FolderEnumerationMode

    Can I change FolderEnumerationMode?

    Yes. The Set-SmbShare cmdlet supports the -FolderEnumerationMode parameter with AccessBased and Unrestricted values.

    Why can a user see a folder but not open it?

    The share may be using Unrestricted enumeration, which can display files and folders even when the user does not have permission to access them. Check both the enumeration mode and the actual SMB and NTFS permissions.

    Related SMB Guides

    Final Thoughts

    Checking SMB Folder Enumeration Mode in Windows 11 is useful when you need to understand why users see certain files and folders on a network share.

    The key property is FolderEnumerationMode, which supports AccessBased and Unrestricted. Access-based enumeration can provide a cleaner and less revealing directory listing by hiding objects that users do not have permission to access.

    However, folder enumeration should not be confused with SMB share permissions, NTFS permissions, SMB leasing, oplocks, caching, encryption, or Continuous Availability. Each feature controls a different part of SMB behavior.

    When troubleshooting a missing or inaccessible folder, check the enumeration mode together with the SMB share ACL, NTFS permissions, the underlying folder, and the active SMB connection. This gives you a much clearer picture of whether the problem is related to visibility, permissions, or the network share itself.

    LihatTutupKomentar