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

Hi,

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.

Thanks.
LVL 9
Senior IT System EngineerIT ProfessionalAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AquatoneCommented:
0
Senior IT System EngineerIT ProfessionalAuthor Commented:
Thanks man, but it doesn't talk about the cross domain functionality ?
0
AquatoneCommented:
Can you create sharepoints to each domain resource on each DC/server and have the script copy to that?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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

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

REM copyfolder1.cmd
REM 

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

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.