BITS Transfer a file with multiple domains

How can I transfer files between servers in different domains?

i.e
PS C:\Users\Desktop> Import-Module bitstransfer
PS C:\Users\Desktop> $c=get-credential
PS C:\Users\Desktop> start-bitstransfer -Credential $c -source \\server\c$\test.txt -destination .

conclusion:

Start-BitsTransfer : Cannot find path '\\server\c$\test.txt' because it does not exist.

I have rights to learn this server, but I can not use BitsTransfer.

It works only if I have \ server \ c $ installed as a shared resource (i.e. using the net use command), but I want to avoid this.

thank

+4
source share
1 answer

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\ .
  • contoso\user, Credential = contoso\admin, Start-BitsTransfer = :
    • , . , Credential, .
  • 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 .
#Success

net use \\server\c$ /delete
#Error: Cannot find path

(, contoso\admin net use)

, net use . , , . .

, , , -Credential, . , , , , , .

+3

Source: https://habr.com/ru/post/1532154/


All Articles