I am trying to copy either entire log folder or files inside the log folder from a specific path to a shared path for about 50 servers. I am a little confused how do i get the server name on my destination if i have to copy entire files from the folder…
Have you tried to search for a solution? Your task sounds like a very common task and there are probably thousands of examples available in the internet or even here in this forum.
Anyway … it will be hard to help with meaningful advises with that little information you gave.
Hmmm … if you expected to find something perfectly fitting for your special needs you probably expected too much. But you can find something to start with at least. Don’t be lazy. Start with a few lines of code and when you get stuck you come back and we will try to help you. But we will not write ready to use code from scratch for you on request.
That’s a local copy job. You told something about 50 server and a shared path?
And please - when you post code, error messages, sample data or console output format it as code, please.
In the “Text” view you can use the code tags “PRE”, in the “Visual” view you can use the format template “Preformatted”. You can go back edit your post and fix the formatting - you don’t have to create a new one.
Thanks in advance.
When you post code, error messages, sample data or console output format it as code, please.
In the “Text” view you can use the code tags “PRE”, in the “Visual” view you can use the format template “Preformatted”. You can go back edit your post and fix the formatting - you don’t have to create a new one.
Thanks in advance.
Just to mention it: You need to have administrative rights on the target computers.
The last row you posted seems like you have too much backslashs in your original code. Either in your file with computernames or in your variable $destination.
Just to mention it … when you copy files from a remote computer to a remote share and neither of those are on the local computer the files get copied from the remote computer to the local computer the script runs on and then to the destination share. If you care about speed and less stress for your network you should run this from the computer the destination share is on.