1
votes

A colleague of mine has issues with his VPN connection. It seems that his operating system resets the proxy settings and he needs to change it back manually. Is there a way to set up vpn and proxy using powershell?

He is using Windows 7 so Powershell 2 is a go. If possible, XP as well.

He is using the Juniper Networks SA client: http://www.juniper.net/support/products/sa/

2

2 Answers

3
votes

I downloaded it and it seems it had command line params, etc

nclauncher /? 
nclauncher [-url Url] [-u username] [-p password] [-r realm] [-help] [-stop] [-signout] [-version] [-d DSID] [-cert client certificate] 

For example:

nclauncher.exe -url https://sa.testing.com -u giantsUser -p password123 -r Users  

So the powershell script will be something like this:

$url = "https://sa.testing.com"
$username = "giantsUser"
$password = Read-Host -assecurestring "Please enter your password:"

cd "C:\Program Files\Juniper Networks\Network Connect 6.5.0"

.\nclauncher -url $url -username $username -p $password # other params ...

If you know a better solution let me know and I will accept is still.

0
votes

This is probably better suited for Super User but setting the proxy can by done by setting the registry settings. Here is an example how:

http://devpinoy.org/blogs/velocity/archive/2007/06/23/setting-proxy-settings-in-ie-using-powershell.aspx

As for the VPN, the solution depends on the VPN client software, which you have not specified...