Hello all,<\/p>\n
I have a list of servers in csv file. on the servers we have some files in a particular folder. we want to copy them to different folder. I want to create script as it should run every 15 minutes.<\/p>\n
Regards<\/p>","upvoteCount":3,"answerCount":4,"datePublished":"2018-08-07T00:39:49.000Z","author":{"@type":"Person","name":"tkr99","url":"https://community.spiceworks.com/u/tkr99"},"suggestedAnswer":[{"@type":"Answer","text":"
Hello all,<\/p>\n
I have a list of servers in csv file. on the servers we have some files in a particular folder. we want to copy them to different folder. I want to create script as it should run every 15 minutes.<\/p>\n
Regards<\/p>","upvoteCount":3,"datePublished":"2018-08-07T00:39:49.000Z","url":"https://community.spiceworks.com/t/powershell-script-to-copy-files-from-list-of-servers/666251/1","author":{"@type":"Person","name":"tkr99","url":"https://community.spiceworks.com/u/tkr99"}},{"@type":"Answer","text":"
Are those all in the same folder on those servers? Or does the CSV have the full path?<\/p>\n
$csv = Import-CSV \"c:\\folder\\file.csv\"\n\nforeach($line in $csv){\n Copy-item \"\\\\$($line.servername)\\c$\\folder\" -Destination \"\\\\server\\share\"\n}\n<\/code><\/pre>\nin theory, something like this and then schedule it with task scheduler.
\nIt assumes your CSV has a column called ‘servername’<\/p>\n
https://community.spiceworks.com/how_to/17736-run-powershell-scripts-from-task-scheduler<\/a><\/p>","upvoteCount":1,"datePublished":"2018-08-07T00:45:34.000Z","url":"https://community.spiceworks.com/t/powershell-script-to-copy-files-from-list-of-servers/666251/2","author":{"@type":"Person","name":"Neally","url":"https://community.spiceworks.com/u/Neally"}},{"@type":"Answer","text":"This is not a script writing service, you should come up with your own code and let us know where you are stuck for your help just see the script below and to schedule it every 15 minutes use task schedular<\/p>\n
https://community.spiceworks.com/scripts/show/4088-copy-files-folders-to-multiple-remote-computers-powershell<\/a><\/p>","upvoteCount":0,"datePublished":"2018-08-07T00:49:14.000Z","url":"https://community.spiceworks.com/t/powershell-script-to-copy-files-from-list-of-servers/666251/3","author":{"@type":"Person","name":"jitensh","url":"https://community.spiceworks.com/u/jitensh"}},{"@type":"Answer","text":"What have you tried so far?<\/p>\n
Have you read the sticky post at the top of the PowerShell forum page? PLEASE READ BEFORE POSTING! Read if you're new to the PowerShell forum!<\/a><\/p>","upvoteCount":0,"datePublished":"2018-08-07T07:53:06.000Z","url":"https://community.spiceworks.com/t/powershell-script-to-copy-files-from-list-of-servers/666251/4","author":{"@type":"Person","name":"DoctorDNS","url":"https://community.spiceworks.com/u/DoctorDNS"}}]}}