From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VPN connection

Hello everybody, I'm developping the monitoring system of water turbines. There is CompactRIO and PC at the powerplant. I want to open VPN connection, run the application in my office and read shared variables from the powerplant. Labview have any function to open VPN. But it could be done via Windows command line. Do you know how I could send command from Labview to command line and open VPN? And after close the application to leave VPN? 

0 Kudos
Message 1 of 11
(8,671 Views)

Do you mean open the VPN connection to access the Office network from home?

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 11
(8,640 Views)

Well, I've done it already.

I've used System exec.vi and I've connected to command line input the string: rasdial "VPN name" user password. To disconnect I've used string: rasdial "VPN name" /disconnect.

It works very well 🙂

0 Kudos
Message 3 of 11
(8,598 Views)

Having a VPN user name and password in plain text as source in an application would make any IT professional a little nervious.  I'm hoping for their sake that passwords expire every 6 months or so.

0 Kudos
Message 4 of 11
(8,528 Views)

@mmarrtinn wrote:

Well, I've done it already.

I've used System exec.vi and I've connected to command line input the string: rasdial "VPN name" user password. To disconnect I've used string: rasdial "VPN name" /disconnect.

It works very well 🙂


I did the same thing using rasdial.

Is there a way to enumerate VPN name?

 

 

George Zou
0 Kudos
Message 5 of 11
(7,038 Views)

Hi zou,

 

You can write the vpn name string array into the String[] property of a ring.

 

Ring.PNG

0 Kudos
Message 6 of 11
(7,017 Views)

Thanks for reply.

 

But I don't know the VPN name on users computer.

I want to find a list of VPN connections configured on the users computer.

 

George Zou
0 Kudos
Message 7 of 11
(7,013 Views)

Hi,

 

If you are using win 7 or later and have powershell, try this command in command prompt:

 

powershell Get-VpnConnection -AllUserConnection

 

 

0 Kudos
Message 8 of 11
(7,006 Views)

Thanks.

It seem the command is not recognized by powershell:

image.png

 

George Zou
0 Kudos
Message 9 of 11
(7,001 Views)

Hi,

 

Maybe your powershell is of older version or is missing the vpnclient module. Did you try using the latest version powershell?  I'm not really familiar with powershell so I'm not sure. I think this question can be asked at the microsoft forum.

 

Here is the information on this command.

0 Kudos
Message 10 of 11
(6,995 Views)