Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1000
  • Last Modified:

Powershell script to schedule copy files between two different domain servers ?


I'm wondering if it is possible to create powershell script to copy file between two fileserver in different domain on scheduled basis ?

\\Fileserver1.domain1.com\Folder1 into \\Fileserver1.domain2.com\Folder1

every 6 AM in the morning.

Senior IT System Engineer
Senior IT System Engineer
2 Solutions
Senior IT System EngineerIT ProfessionalAuthor Commented:
Thanks man, but it doesn't talk about the cross domain functionality ?
Can you create sharepoints to each domain resource on each DC/server and have the script copy to that?
Who's Defending Your Organization from Threats?

Protecting against advanced threats requires an IT dream team – a well-oiled machine of people and solutions working together to defend your organization. Download our resource kit today to learn more about the tools you need to build you IT Dream Team!

Senior IT System EngineerIT ProfessionalAuthor Commented:
unfortunately no we are not suggested to implement WSS on the other site :-|
Darn. It was a good idea anyway.
Senior IT System EngineerIT ProfessionalAuthor Commented:
yes it is, If I can have WSS then I wouldn't be posting this question of course :-)
how about robocopy?

Fix the batch file and set as a scheduled task on Fileserver1.domain2.com

REM copyfolder1.cmd

REM the net use command is needed only if there is no trust.
REM easiest(?) to run from Fileserver1.domain2.com

REM establishes credentials to source server
net use \\Fileserver1.domain1.com\ipc$ /user:domain1.com\username password

REM you should check out if you need different robocopy switches
robocopy \\Fileserver1.domain1.com\Folder1 \\Fileserver1.domain2.com\Folder1 /mir /r: /w:1

Open in new window

QlemoC++ DeveloperCommented:
I would agree to using robocopy instead of PowerShell for this simple task. It is different if you want to do more complex tasks, as copying to multiple locations in one go, for example.

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now