# Copy files across domains

**URL:** <https://forums.powershell.org/t/copy-files-across-domains/12249>\
**Category:** PowerShell Help\
**Created:** [March 26, 2019, 7:30am UTC](https://forums.powershell.org/t/copy-files-across-domains/12249 "2019-03-26T07:30:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eusebio](https://avatars.discourse-cdn.com/v4/letter/e/c0e974/32.png) [@eusebio](https://forums.powershell.org/u/eusebio)\
**Post date:** [March 26, 2019, 7:30am UTC](https://forums.powershell.org/t/copy-files-across-domains/12249/1 "2019-03-26T07:30:44Z")

</div>

Hi

I need to copy a single file from domain A to domain B. I have different usernames on each domain and I know I have enoungh privileges on each one.

I cann’t be able to make the copy. Im trying with robocopy and with Copy-Item ☹

I’m doing it manually, from de domain A, I make a “network map” with the “use different user” option to map the domain B location. And then use the windows explorer to do the copy. I want to make the copy by script to schedule the task.

Please help…!

thanks in advance

Eusebio M

&nbsp;

---

<div class="post-metadata">

**Author:** ![pwshliquori](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/pwshliquori/32/222_2.png) [@pwshliquori](https://forums.powershell.org/u/pwshliquori)\
**Post date:** [March 26, 2019, 7:41am UTC](https://forums.powershell.org/t/copy-files-across-domains/12249/2 "2019-03-26T07:41:30Z")

</div>

Hi Eusebio,

Create a PSDrive that points to the destination location to do the copy.

[pre]  
New-PSDrive -Name Dest -PSProvider FileSystem -Root \destdomain\share -Credential \<credential\>

Copy-Item -Path localPath -Destination Dest:\ -Recurse  
[/pre]

pwshliquori

---

<div class="post-metadata">

**Author:** ![eusebio](https://avatars.discourse-cdn.com/v4/letter/e/c0e974/32.png) [@eusebio](https://forums.powershell.org/u/eusebio)\
**Post date:** [March 26, 2019, 8:21pm UTC](https://forums.powershell.org/t/copy-files-across-domains/12249/3 "2019-03-26T20:21:18Z")

</div>

hi

Thanks , it works…!

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:33pm UTC](https://forums.powershell.org/t/copy-files-across-domains/12249/4 "2024-05-16T20:33:04Z")

</div>


