copy files via VNC and FTP

Welcome Forums General PowerShell Q&A copy files via VNC and FTP

Viewing 8 reply threads
  • Author
    Posts
    • #263259
      Participant
      Topics: 2
      Replies: 4
      Points: 31
      Rank: Member

      Hello all,

      i have a small Problem, and i want to know if i can solve this by using Powershell. I have to connect to a customer PC daily to copy some files from a connected measurement device.

      The connection to the customer-PC is done using UltraVNC. Once I am connected, I have to use Filezilla to connect to a further device to copy some data from it (First i have to copy them to the remote PC, then i have to transfer them back to my local PC). I know… the description is a bit confusing… but i hope it is understandable…

      Is it possible to copy the data from the device with a script to my local PC just with one click?

      Thanks for your answers.

    • #263304
      Participant
      Topics: 10
      Replies: 44
      Points: 239
      Helping Hand
      Rank: Participant

      What is the connnection method Filezilla uses (FTP, SMB, etc.) to get the file?  I’d start with seeing if I could duplicate that process from PowerShell on the customer-PC as a first step.

      If you can script the file copy from the customer-PC to the remote device using PowerShell, you could set this up as a Windows Scheduled Task to run automatically from the customer-PC.

      To verify it worked, you could have the task send a confirmation e-mail.

    • #263307
      Participant
      Topics: 16
      Replies: 1794
      Points: 3,300
      Helping Hand
      Rank: Community Hero

      Looks like WinScp has a way to automate a FiieZilla upload:

      https://winscp.net/eng/docs/guide_filezilla_automation

      If you are permitted to install software on the device, WinScp has a ton of Powershell examples. Once you have a script that can perform the upload, VNC is not required, you just setup a scheduled task as Darwin stated.

    • #263349
      Senior Moderator
      Topics: 10
      Replies: 184
      Points: 980
      Helping Hand
      Rank: Major Contributor

      Can you access the device that you’re pulling the files from directly, or is it on a separate LAN or something? If you can skip the step of connecting to the customer PC, and just connect to the remote device from your computer you can make your life easier.

    • #263475
      Participant
      Topics: 2
      Replies: 4
      Points: 31
      Rank: Member

      First of all: thanks for your answeres. i honestly did not expect this.

      @Darwin: The protocol which is used by Filezilla is FTP. You are right. This is a good idea as a first step to get the files to the remote machine. I will give it a try as soon as possible.

      Unfortunantely @Rob it is not possible to install a software on the measurement device. But i can install software on the remote machine (where the device is connected to) if this helps…



      @grokkit
      : No. I can not access the device directly. I have to connect to the remote machine first.

      But maybe powershell is not the right way to make my daily task a bit easier… Is there a possibility to connect to a device with using 2 IP-Adresses in a row? something like “copy data from IP-Adress(remote)\IP-Adress(device)\Path_on_device  to dest”?

    • #263481
      Participant
      Topics: 2
      Replies: 4
      Points: 31
      Rank: Member

      Something went wrong… i can not see my answer on your posts…. so i have to try/type it again 🙂

      To be honest… i did not expect to get any answers to this uncommon problem…

      @Darwin: The Protocol which Filzilla is using, is FTP. You are right. This is a good idea to copy the files from measurement device to the remote machine as a first step. I will give it a try as soon as possible.

      @Rob: Unfortunately I am not allowed to install any software on the measurement device. But i can install software on the remote machine if this helps.



      @grokkit
      : No, i have not direct access to the device itself. I have to connect to a remot machine first. As a next step i can connect to the device which is connected by ethernet

      But maybe powershell is not the best solution to make may daily task a bit easier. Do you guys know, if there is a possibility to connect to a device using 2 IP-Adresses in a row? For example: “copy IP-Adress(remote_machine)\IP-Adress(measurement_device)\Path_device to dest”?

      Thanks in advance

    • #263549
      Participant
      Topics: 10
      Replies: 44
      Points: 239
      Helping Hand
      Rank: Participant

      The double-hop problem would stop you from connecting through the customer-PC to get to the device all using PowerShell.   Yeah, there are ways around that, but I try to avoid them due to security concerns.

      I would suggest getting the FTP set up as a scheduled task on the customer-PC to get the file.  Then set up a scheduled task on your PC to get the file from customer-PC.  Both steps should be able to be done in PowerShell without much difficulty.  Automation!  🙂

    • #263654
      Senior Moderator
      Topics: 10
      Replies: 184
      Points: 980
      Helping Hand
      Rank: Major Contributor

      Darwin’s answer is probably the best way to make this work. Basically, write one script that connects from the customer PC to the remote device to get the files. Put this script on the customer PC and set it up as a scheduled task so that it gets the files automatically and you never have to touch it. Then write a second script that you run from your PC that connects to the customer PC and gets the files that the first script downloaded to it. You could also set this up as a scheduled task on your PC, or just run it manually when you need to.

    • #263849
      Participant
      Topics: 2
      Replies: 4
      Points: 31
      Rank: Member

      Yes. I think you are right.

      I will try to set up the two scripts as you suggested.

      Thank you very much for your help and your proposals.

Viewing 8 reply threads
  • You must be logged in to reply to this topic.