Different options were asked. I have no problem finding in the local directory with the code snippet below.
EXEC MASTER.sys.xp_dirtree 'C:\', 1, 1
When I switch the path to the network location, the results are empty.
EXEC MASTER.sys.xp_dirtree '\\Server\Folder', 1, 1
At first I thought it might be related to permissions. I added the SQL Server service to the ACLs on the shared volume, as well as to the security group.
Any help or direction to point me is much appreciated or even another way to get a list of files in a directory and subdirectories.
[Changed]
source share