What version of Samba?
One solution I found was to disable Client Signing, although it comes with potential security risks.
https://www.digistor.com.au/the-latest/cat/digistor-blog/post/el-capitan-smb-trouble/
Yes. I tried that and it did not appear to help. I believe I am running SMB 2 on Windows server 2008 R2. You are not seeing this in your environment?
Did you ever find a solution to this @agerson ? We seem to have the same problem. Whilst the client signing solutions seem to reference a slow file transfer speed, the problem we're seeing is very slow folder enumeration and in some instances NTFS permissions are not coming through - users are denied access to folders they should have access to. Frustrating!
@pinnockt, I ended up creating a brand new share, booting the machine into linux to ensure no windows meta data got copied, scripted a copy of all the data to the new share, then booting back into Windows and setting up the permissions from scratch. Its not super fast, but it did improve.
OS X 10.9 - 10.11: sudo sh -c "echo '[default]' >> /etc/nsmb.conf; echo 'smb_neg=smb1_only' >> /etc/nsmb.conf"
macOS 10.12 or newer: sudo sh -c "echo '[default]' >> /etc/nsmb.conf; echo 'protocol_vers_map=1' >> /etc/nsmb.conf"
FWIW
Disable local SMB directory enumeration caching
https://support.apple.com/en-us/HT207520
I have not sussed this problem out, but here is some potentially useful info.
At first I though that this had the stink of a DNS timeout, but I ruled that out pretty quickly.
Below is the output from smbutil statshares -a from a client running macOS 10.12 (Sierra). I have tried various combination of turning client signing off and changing some of the TCP values, but to no avail. The client machine is linked to the 172.30.4.0/24 network thru a Checkpoint VPN server, using the built in MacOS L2TP client.
The first share called nwasg is from an iMac running Sierra. The directory listings are sub 1 sec.
The second share, nwasg_docs is to a machine running AIX v6.1 & a Samba 3.6 server. The directory listing is plus 1 min. The SAMBA build is a prebuilt that comes with the AIX distritubion and does not appear to support any protocol above SMB_1.
I believe I might solve this problem by building Samba 4+
Voila:
ACE-Mac10:~ bill$ smbutil statshares -a
SHARE ATTRIBUTE TYPE VALUE
nwasg
SERVER_NAME 172.30.4.11
USER_ID 501
SMB_NEGOTIATE SMBV_NEG_SMB1_ENABLED
SMB_NEGOTIATE SMBV_NEG_SMB2_ENABLED
SMB_NEGOTIATE SMBV_NEG_SMB3_ENABLED
SMB_VERSION SMB_3.0
SMB_SHARE_TYPE DISK
SIGNING_SUPPORTED TRUE
SIGNING_REQUIRED TRUE
EXTENDED_SECURITY_SUPPORTED TRUE
UNIX_SUPPORT TRUE
LARGE_FILE_SUPPORTED TRUE
OS_X_SERVER TRUE
FILE_IDS_SUPPORTED TRUE
FILE_LEASING_SUPPORTED TRUE
MULTI_CREDIT_SUPPORTED TRUE
ENCRYPTION_SUPPORTED TRUE
SIGNING_ON TRUE
nwasg_docs
SERVER_NAME 172.30.4.2
USER_ID 501
SMB_NEGOTIATE SMBV_NEG_SMB1_ENABLED
SMB_NEGOTIATE SMBV_NEG_SMB2_ENABLED
SMB_NEGOTIATE SMBV_NEG_SMB3_ENABLED
SMB_VERSION SMB_1
SMB_SHARE_TYPE UNKNOWN
EXTENDED_SECURITY_SUPPORTED TRUE
UNIX_SUPPORT TRUE
LARGE_FILE_SUPPORTED TRUE
@Alaska185 did you end up testing against Samba 4, or finding another resolution?