Configuring VPN Remote Access for the first time on your Sophos XG Firewall? Check out this useful Community post!
Advisory: Sophos XG Firewall - Antivirus service stopped due to failed pattern update. Please visit this KBA for the latest updates
We'd love to hear about it! Click here to go to the product suggestion community
Can anyone help me with a batch script using the CLI?
IWe just recently moved from Dell SonicWall to Sophos. We had a few batch scripts utilizing the NetExtender CLI that I'd like to convert over to use with the Connect CLI.
The first is a connection script that first checks if the VPN is already connected and then connects if it isn't.
Here's what it looked like with NetExtender:
@echo offset NEDIR="C:\Program Files (x86)\SonicWALL\SSL-VPN\NetExtender"chdir /d %NEDIR%for /f "Tokens=2" %%i in ('NECLI showstatus') do set NESTATUS=%%iif %NESTATUS% == Disconnected (start NEGui.exeNECLI connect -s remote.architecturalpartners.com:4433 -u matt -p #Matt2017 -d ap.local) else (Echo Already Connected)
I am definitely not a command prompt expert, so I've tried to make heads or tails out of this and convert it, but it's not working.
I was trying to use the sccli get command to get the status of a connection and search for the text "Connected: 0" which appers in the output, but I'm not doing something right. Again, just not knowing what I'm doing with Windows Command Prompt well enough.
set SCDIR="C:\Program Files (x86)\Sophos\Connect"chdir /d %SCDIR%for /f "Tokens=2" %%i in ('sccli get -n AP_Sophos_Connect') do set SCSTATUS=%%iif sccli get -n AP_Sophos_Connect | findstr "Connected: 0" (sccli enable -n AP_Sophos_Connect) else (Echo Already Connected)
Any help is appreciated!!!
Hi Matt Tyree
I will check this with my team and someone shall get back to you for this query.
Hi Matt Tyree Unfortunately, there are no official scripts available to fulfill your requirement but I would request you to share your post on - https://community.sophos.com/products/xg-firewall/f/sophos-connect/108551/using-sophos-connect-vpn-client, fellow community members will help you further.