![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Send-FTP Script with Error Checking? Hi - I'm new to PowerShell scripting and I'm trying to create a script (I'm not sure if it is supposed to be typed withing the PowerShell window) that will automatically FTP the contents of a directory (all SQL .BAK files) on a server in one location to a FTP server in another location. I would also like the script to ZIP the contents of the original directory before FTPing them to the remote server. The script also needs to be doing some sort of error checking so that if a problem occurs, it can report it to me in some sort of text file... Is this even possible? I created a .PS1 file with the following code (which is insanely simple) to move a basic txt file from one location to another and it worked fine minus all of the other things I want to do. Am I heading in the right direction or not??? send-ftp -server ftp.filetransfercentral.com -user xxxxx -password xxxxx -localfile c:\test.txt -remotefile test3.txt Thanks in advance for the help! Michael mike.trantas@xxxxxx |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Send-FTP Script with Error Checking? Michael Trantas wrote:
I see they support erroraction and errorvariable: http://blogs.msdn.com/powershell/arc...rvariable.aspx What you're asking for is all possible. I just can't do it for you right now. Someone else migth step up or I might be able to provide you all the code in the next 24 hours. If the script fails, you want an email report perhaps? Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Send-FTP Script with Error Checking? Yes, that's exactly what I'm talking about - the process should be as follows: ZIP the files in a directory --> FTP the ZIP file to a server in a remote location and place in a specific directory --> report (or error check) the transfer by sending a TXT file to my e-mail address when the transfer is complete. Yes, I am using NetCmdlets too. Thank you for your help - I'm in no rush so anything you can do would be appreciated. I just have no clue about scripting or writing code so anything you can do would need a detailed explaination for me to understand... Thanks again! Michael "Marco Shaw [MVP]" wrote:
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #4 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Send-FTP Script with Error Checking? The other variable I forgot to include in this is that while it is being zipped, it needs to be encrypted. The SQL data included in these BAK files contains social security numbers so it needs to be highly secure. I know that this throws a wrench into the whole process so I'll apologize now before it gets too hairy. "Michael Trantas" wrote:
| ||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||
| | #5 (permalink) | ||||||||||||
| Guest | Re: Send-FTP Script with Error Checking? Michael Trantas wrote:
I'm not so sure about things now, but its a good challenge. -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
My System Specs![]() | |||||||||||||
| | #6 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Send-FTP Script with Error Checking? Marco - Initially, the ZIP file needs to be encrypted (DES or the like). I know that the FTP transfer process is not encrypted but if you know a way to make it encrypted, that would be great - we really don't any type of secured FTP transmission methods right now... Thanks again - I'm really looking forward to seeing what you come up with and learning how you did it! Michael "Marco Shaw [MVP]" wrote:
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #7 (permalink) | ||||||||||||
| Guest | Re: Send-FTP Script with Error Checking? Michael Trantas wrote:
I just noticed that NetCmdlets' write-zip can do AES encryption. Does that work for you? Unencryption is done via a password though. Maybe you needed something else like a cert or something? Feel free to email me at marco DOT shaw AT gmail DOT com Also, for the SSL/SSH FTP transfer, your server must also support it. You have a system/network administrator you can ask about that? Marco | ||||||||||||
My System Specs![]() | |||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Inactive printer-checking script | h.pedersen.amark | PowerShell | 5 | 07-16-2008 11:40 AM |
| Re: PS Script to automate checking date of file and delete if old | Shay Levy [MVP] | PowerShell | 0 | 07-09-2008 06:19 PM |
| Error checking with WMI Lastreboot script | TimParker | PowerShell | 1 | 06-19-2008 01:43 AM |
| Help with Powershell - Disk space checking script - New to PS | darren1 | PowerShell | 5 | 04-26-2008 12:26 AM |
| Re: checking for results when executing a script | Kiron | PowerShell | 0 | 12-06-2007 08:28 PM |