From what I found out, I think the problem is with how BitsTransfer works. It only works interactively (i.e., as a registered and active user). From the Microsoft documentation:
* -BitsTransfer , , Windows, BITS, . , . , BITS PowerShell script, , BITS , Task Scheduler " " . - Windows PowerShell BITS
, (, , ..), , .
, ( contoso\user, contoso/admin, ) :
- contoso\user, Credential = contoso\user, Start-BitsTransfer = :
- contoso\user, Credential = contoso\admin, Start-BitsTransfer = :
- contoso\admin, Credential = contoso\admin, Start-BitsTransfer = .
- contoso\admin, Credential = contoso\user, Start-BitsTransfer = .
- , , , , EventID 4624, , contoso\admin, , .
runas. contoso\user:
runas /user:contoso\admin powershell.exe run Start-BitsTransfer = Error: Start-BitsTransfer : The operation being requested was not performed because the user has not logged on to the network. The specified service does not exist. (Exception from HRESULT: 0x800704DD)- .
-Credential, . runas, , , , ... .
runas /profile /user:contoso\admin powershell.exe Start-BitsTransfer = Error: Start-BitsTransfer : The operation being requested was not performed because the user has not logged on to the network. The specified service does not exist. (Exception from HRESULT: 0x800704DD)- ... runas... runas pararmeter - netonly:
runas /netonly /user:contoso\admin powershell.exe run Start-BitsTransfer = Error: Start-BitsTransfer : Access is denied.
, . :
$c = Get-Credential -UserName 'consoso\admin'
net use \\server\c$
Start-BitsTransfer -Credential $c -source \\server\c$\test.txt -destination .
net use \\server\c$ /delete
(, contoso\admin net use)
, net use . , , . .
, , , -Credential, . , , , , , .