2017-02-17 60 views
0

我正在使用VSTS版本管理。第一步是做一個「Windows機器文件複製」。設置如下。執行robocopy時出現「訪問被拒絕」的錯誤消息時失敗。以下設置中顯示的文件路徑被轉換爲\\ machine \ e $ \ xxxx \ TargetFolder。我爲什麼拒絕訪問?如果我在目標文件夾上創建共享文件夾並將目標文件夾更改爲:\\ machine \ TargetFolder,則不會收到此消息。 Admin用戶是本機上的本地管理員。如果沒有共享文件夾,Windows計算機文件複製將不起作用

我的問題是爲什麼我需要設置共享文件夾才能使其工作。爲什麼不能用它的管理共享(即\\機\ E $ \ XXXX \ TargetFolder)

enter image description here

這裏是日誌。源服務器和目標服務器都是Win 2012R2服務器。 UAC在目標服務器上關閉。我試過/ B和/ ZB作爲參數,並沒有奏效。

2017-02-20T12:21:10.4545267Z Downloading artifact 
2017-02-20T12:21:11.4375965Z Cleaning artifacts directory: C:\VSTS_agent\ReleaseManagementVSTS\r1\a 
2017-02-20T12:21:11.6306012Z Cleaned artifacts directory: C:\VSTS_agent\ReleaseManagementVSTS\r1\a 
2017-02-20T12:21:11.6396014Z Starting artifacts download... 
2017-02-20T12:21:11.6426015Z Downloading linked artifact Release Build of type Build... 
2017-02-20T12:21:11.6486018Z Ensuring artifact folder C:\VSTS_agent\ReleaseManagementVSTS\r1\a\Release Build exists and is clean. 
2017-02-20T12:21:11.6856039Z Preparing to get the list of available artifacts from build 
2017-02-20T12:21:12.0926382Z Preparing to download artifact: release 
2017-02-20T12:21:12.1066374Z Artifact Type: ServerDrop 
2017-02-20T12:21:12.5536635Z Caching items under 'release' in the file container... 
2017-02-20T12:21:12.7186787Z Caching complete. (165 ms) 
2017-02-20T12:21:17.8480056Z Download complete. 
2017-02-20T12:21:17.8500047Z 51 placed file(s): 51 downloaded, 0 empty 
2017-02-20T12:21:17.8500047Z 11 MB downloaded at 2188 KB/sec. Download time: 00:00:05.0976254. Parallel download limit: 4. 
2017-02-20T12:21:17.8510054Z Downloaded linked artifact Release Build 
2017-02-20T12:21:17.8510054Z Finished artifacts download 
2017-02-20T12:21:17.8610039Z ##[section]Finishing: Download Artifacts 
2017-02-20T12:21:17.8690051Z ##[section]Starting: Copy files from $(System.DefaultWorkingDirectory)/Release Build/release 
2017-02-20T12:21:17.9680113Z ============================================================================== 
2017-02-20T12:21:17.9680113Z Task   : Windows Machine File Copy 
2017-02-20T12:21:17.9680113Z Description : Copy files to remote machine(s) 
2017-02-20T12:21:17.9690126Z Version  : 1.0.39 
2017-02-20T12:21:17.9690126Z Author  : Microsoft Corporation 
2017-02-20T12:21:17.9690126Z Help   : [More Information](https://go.microsoft.com/fwlink/?linkid=627415) 
2017-02-20T12:21:17.9690126Z ============================================================================== 
2017-02-20T12:21:18.0380182Z Preparing task execution handler. 
2017-02-20T12:21:19.8101219Z Executing the powershell script: C:\VSTS_agent\ReleaseManagementVSTS\_tasks\WindowsMachineFileCopy_xxxx\1.0.39\WindowsMachineFileCopy.ps1 
2017-02-20T12:21:24.0233892Z Copy started for - 'machine' 
2017-02-20T12:21:28.8116953Z 
2017-02-20T12:21:28.8116953Z ------------------------------------------------------------------------------- 
2017-02-20T12:21:28.8116953Z ROBOCOPY  ::  Robust File Copy for Windows        
2017-02-20T12:21:28.8116953Z ------------------------------------------------------------------------------- 
2017-02-20T12:21:28.8116953Z 
2017-02-20T12:21:28.8146952Z Started : Monday, February 20, 2017 7:21:28 AM 
2017-02-20T12:21:28.8156949Z 2017/02/20 07:21:28 ERROR 5 (0x00000005) Getting File System Type of Destination \\machine\E$\xxx\TargetFolder\ 
2017-02-20T12:21:28.8156949Z Access is denied. 
2017-02-20T12:21:28.8156949Z 
2017-02-20T12:21:28.8156949Z 
2017-02-20T12:21:28.8156949Z Source : C:\VSTS_agent\ReleaseManagementVSTS\r1\a\Release Build\release\ 
2017-02-20T12:21:28.8167052Z  Dest - \\machine\E$\xxx\TargetFolder\ 
2017-02-20T12:21:28.8167052Z 
2017-02-20T12:21:28.8167052Z  Files : *.* 
2017-02-20T12:21:28.8167052Z   
2017-02-20T12:21:28.8167052Z Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30 
2017-02-20T12:21:28.8167052Z 
2017-02-20T12:21:28.8167052Z ------------------------------------------------------------------------------ 
2017-02-20T12:21:28.8186939Z 
2017-02-20T12:21:28.8196951Z 2017/02/20 07:21:28 ERROR 5 (0x00000005) Creating Destination Directory \\machine\E$\xxx\TargetFolder\ 
2017-02-20T12:21:28.8196951Z Access is denied. 
2017-02-20T12:21:28.8196951Z 
2017-02-20T12:21:28.8977003Z \\machine was deleted successfully. 
2017-02-20T12:21:28.8977003Z 
2017-02-20T12:21:28.9177039Z ##[error]System.Management.Automation.RuntimeException: Copying failed for resource : machine 
2017-02-20T12:21:28.9177039Z Copying failed. Consult the robocopy logs for more details. ---> System.Management.Automation.RuntimeException: Copying failed for resource : machine 
2017-02-20T12:21:28.9177039Z Copying failed. Consult the robocopy logs for more details. 
2017-02-20T12:21:28.9177039Z --- End of inner exception stack trace --- 
2017-02-20T12:21:28.9177039Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) 
2017-02-20T12:21:28.9177039Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) 
2017-02-20T12:21:28.9177039Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) 
2017-02-20T12:21:28.9177039Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings) 
2017-02-20T12:21:28.9177039Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings) 
2017-02-20T12:21:28.9187021Z at Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args) 
2017-02-20T12:21:28.9407042Z ##[error]LegacyVSTSPowerShellHost.exe completed with return code: -1. 
2017-02-20T12:21:28.9427038Z ##[section]Finishing: Copy files from $(System.DefaultWorkingDirectory)/Release Build/release 
2017-02-20T12:21:28.9507042Z ##[section]Finishing: Release 
+0

如果使用Windows計算機文件複製任務/步驟,則不需要設置共享文件夾。什麼是詳細構建日誌?你可以在這裏分享嗎? –

+0

日誌已添加到帖子中。 –

+0

嘗試使用該用戶登錄該機器並在E中創建一個新文件夾,然後使用它。另一方面,嘗試指定另一個管理員帳戶並檢查結果。 –

回答

0

此問題已通過使用Active Directory帳戶解決。這解決了無法使用管理員共享的Robocopy的問題。這適用於AD用戶有權訪問的計算機,以及AD無法訪問但本地管理員Windows帳戶的設置與AD帳戶名稱相同的計算機。

相關問題