Globalprotect VPN batch file or C# code
Update: just use OpenConnect v8.00 or newer. GlobalProtect support has been incorporated into the "official" OpenConnect builds as of v8.00. So GP support will Just Work™ with a recent official build.
———
You cannot do this with the official GP client. However, I have recently extended the fantastic open-source VPN client OpenConnect to support the PAN GlobalProtect VPN, both in its SSL-VPN and IPsec/ESP modes. It acts just like a native client and you can run it from the command line in a fully automated manner.
This is a work in progress, but I've been using it for real work already and it works very well for me. Having other people test it would be awesome and I welcome your feedback!
You'll need to build the globalprotect
branch from this repository:
https://github.com/dlenski/openconnect
... and then run it like this to test it (you can omit the --certificate
part if your VPN doesn't use a client certificate):
echo password | openconnect --user username --passwd-on-stdin \
--protocol=gp [--certificate=my_cert_with_pk.pem] \
gp-gateway-server.company.com --dump -vvv
(I have not yet tested this build under Windows, but the official OpenConnect builds are all Windows-compatible and there is nothing particularly special about this one.)
There is no such automation possible with globalprotect VPN client