Try with one of the servers mapping a drive to the other server you are trying to create the files at under the context of the user account you are using to run the script and make it persistent and then try to that drive.
Jared Jared 1 1 gold badge 10 10 silver badges 19 19 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses.
Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Related Copying items to B is done with -ToSession. Note that local paths are used in both cases; you have to keep track of what server you're on. By using UNC paths instead of local filesystem paths, you help to ensure that your script is executable from any client system with access to those UNC paths.
If you use local filesystem paths, then you are cornering yourself into running the script on a specific computer. Just in case that the remote file needs your credential to get accessed, you can generate a System.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Copy file remotely with PowerShell Ask Question. Asked 9 years, 7 months ago. Active 5 months ago. Viewed k times.
Improve this question. Peter Mortensen Add a comment. Active Oldest Votes. Improve this answer. Community Bot 1 1 1 silver badge. Jeroen Mostert Jeroen Mostert I have found it is not necessary for both servers to have PS 5 installed.
I just performed a successful test where only the source server Windows 10 had PS 5 installed. Also will share the Client requirements with real time setups if possible I will provide you with screenshots. View all posts by Sri. This site uses Akismet to reduce spam. Learn how your comment data is processed. Skip to content PowerShell Script for Copying the Latest Backup File: This script copies local sql backup files to remote folder and also it deletes old backup files.
0コメント