- This topic has 8 replies, 4 voices, and was last updated 1 week, 3 days ago by
October 14, 2020 at 8:00 am #263259
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.
October 14, 2020 at 10:39 am #263304ParticipantTopics: 10Replies: 44Points: 239Rank: 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.
October 14, 2020 at 10:52 am #263307ParticipantTopics: 16Replies: 1794Points: 3,300Rank: Community Hero
Looks like WinScp has a way to automate a FiieZilla upload:
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.
October 14, 2020 at 2:40 pm #263349Senior ModeratorTopics: 10Replies: 184Points: 980Rank: 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.
October 15, 2020 at 2:46 am #263475
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”?
October 15, 2020 at 2:59 am #263481
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
October 15, 2020 at 9:15 am #263549ParticipantTopics: 10Replies: 44Points: 239Rank: 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! 🙂
October 15, 2020 at 2:23 pm #263654Senior ModeratorTopics: 10Replies: 184Points: 980Rank: 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.
October 16, 2020 at 5:54 am #263849
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.
- You must be logged in to reply to this topic.