On the Windows client, if multiple people are using the computer, when one is connected and the signs off, their VPN connection is still open when a different user logs in.
Is there any way to make the VPN client run specific to only a single user, or to automatically disconnect when that user logs out?
I’m not seeing any options for that.
User-specific connection
-
- Posts: 1278
- Joined: Sun Feb 14, 2021 10:31 am
Re: User-specific connection
Code: Select all
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff\0\0]
"Script"="C:\Logoff.bat"
"Parameters"=""
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
Logoff.bat
----------
"C:\Program Files\SoftEther VPN Client\vpncmd.exe" localhost /client /cmd AccountDisconnect con-name
-
- Posts: 2
- Joined: Sun Jan 29, 2023 9:02 pm
Re: User-specific connection
Thanks. The command works fine, but I think it's not working for me since I'm on Windows 11 Home - no group policy and those keys didn't exist.
I tried Task Scheduler, but apparently that won't work on logoff.
Apparently there are some hacky workarounds, but I don't want to mess with that. Maybe I'll put it on log in of the next user rather than on log out.
Thanks
I tried Task Scheduler, but apparently that won't work on logoff.
Apparently there are some hacky workarounds, but I don't want to mess with that. Maybe I'll put it on log in of the next user rather than on log out.
Thanks
-
- Posts: 1278
- Joined: Sun Feb 14, 2021 10:31 am
Re: User-specific connection
Then edit and import this "Logoff.reg"
Code: Select all
REGEDIT4
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff\0\0]
"Script"="C:\Logoff.bat"
"Parameters"=""
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00