Proxy account not using foreach file enumerator correctly

  • Hi

    I have a job which uses a foreach file enumerator. This job works fine when run locally. When I run it through the proxy account we have for SQL Agent, it is returning no files with the enumerator (verified through the logs, "The For Each file enumerator is empty...").

    When using the proxy account credential's identity in a command-line, the folder can be browsed to and a simple dir will show the files that the foreach file enumerator should be catching, so the proxy account should be able to list and see them.

    Does anyone have any ideas as to what might be causing this problem?

    Thanks for any help,

    Mark

  • We found out what was causing this. The foreach file enumerator was pointed at a folder that was defined as a network share but was actually off the server that it was being run on. This network share had an alias. When we switched the configuration so that the foreach file enumerator's folder was explicitly called by the non-alias name, it started working.

    So, instead of

    "\\serveralias\firstfolder\secondfolder\targetfolder\"

    the variable was populated with:

    "\\servername.serverdomain.etc\firstfolder\secondfolder\targetfolder\"

    and it worked.

    We ran into several red herrings first, as the folders were hidden and configured separately as shortcuts, but that didn't seem to have anything to do with the problem.

    A very frustrating problem, hope this helps someone else. The SQL Server was 2008R2, the Windows Server was 2012.

  • Thanks for posting back with the solution; it's always useful when people do that! 🙂

  • Many thanks mchevallier! I lost a lot a couple of hours in this issue.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply