Looking for a powershell script that can pull a file from a set of PC's and FTP
Posted
by
DangeRuss
on Server Fault
See other posts from Server Fault
or by DangeRuss
Published on 2014-08-07T17:27:51Z
Indexed on
2014/08/20
16:24 UTC
Read the original article
Hit count: 171
I'm looking to write a script (preferably powershell) that will essentially copy a file from a bunch of PC's and FTP it to a server.
So the structure of the environment is that we have a file on multiple PC's (around 50 or so) that need to placed on a server. Sometimes one of the PC's may be turned off so the script would first need to ensure the PC is up and running (maybe a ping result), then it would need to go into a directory on that PC, pull a file off of it, rename the file, place into a source directory, then remove the file. Naming convention doesn't matter, but date/time stamp would be easiest. Ideally, it would be best to first move all the files to a source directory to save on FTP bandwidth, but since the files will be named the same, the files must be renamed during the move process. Move not copy because the directory needs to be empty so the file can be re-created the next day. So once moved to the source directory, now all the files need to be FTP'd to a server for processing.
After all of this, we need to know which PC's on the list did not respond so we can manually retrieve the file so the script should output a file (txt is fine) that will show which PC's were offline.
Everything is one domain and script will be run from an server with admin creds.
Thank you!
© Server Fault or respective owner