Jenkins can't see mapped drive

穿精又带淫゛_ 提交于 2019-11-30 22:48:29
TomSelleck

Following this answer, I managed to get it working.

Solution can be found in Aspera Support's article: How to map network shares into drives to a Windows service permanently.

Solution:

In order for network shares to be mapped into drives and accessible within Windows services, you need to login as the NT AUTHORITY\SYSTEM account.

To do this, download the Sysinternals Suite from Microsoft, and unzip it to a directory, say C:\TEMP The following steps assume that you've unzipped SysInternals to C:\TEMP and all the executables are in there.

  1. Launch a command prompt as Administrator.
  2. CD \TEMP
  3. psexec -i -s cmd.exe
    This launches a new command prompt window, and step 4 should be performed in that new window.
  4. net use Z: \\servername_OR_IP\sharedfolder /u:username /persistent:yes
    Provide the credentials of a user having access to the shared folder.

  5. Create a script that runs on computer startup that has only line 4 in it acccording to Microsoft's article: Assign Computer Startup scripts.

Faced the same issue on Windows Server 2008. Configured the correct user credentials on the Jenkins agent service and restarted it but that did not help either.

Finally what worked is to launch the agent via Java Web Start without installing it as a Windows service.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!