remote Start-BitsTransfer fails when source is UNC path

hi there!

I’m trying to start BITs transfer jobs remotely on several Windows 2016 servers (now supported Win 10 & Win 2016 - https://docs.microsoft.com/en-us/windows/desktop/Bits/using-windows-powershell-to-create-bits-transfer-jobs#to-manage-powershell-remote-sessions) within my script. The code that keeps failing is as follows:

$myCred = Get-Credential

Invoke-Command -ComputerName remote_server_FQDN {Start-BitsTransfer \\sourceFQDN\E$\someFolder\2016VM.vhd \\destFQDN\E$\someFolder\2016VM.vhd -Asynchronous -Authentication Negotiate -credential $args[0]} -Authentication Credssp -Credential $myCred -ArgumentList $myCred

Running this cmdlet will return an “Access is Denied” error message:

icm -computerName remote_server_FQDN {Get-BitsTransfer -AllUsers | Select *}

CredSSP has already been enabled for the server and client (where script is running from) based on this guide: https://devblogs.microsoft.com/scripting/enable-powershell-second-hop-functionality-with-credssp/

Please let me know if anyone has some ideas to make this work.

thanks!

Bao Tran

Why not just create scheduled task on those remote machines and run the code their directly?