User-specific connection

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
jtenos
Posts: 2
Joined: Sun Jan 29, 2023 9:02 pm

User-specific connection

Post by jtenos » Sun Jan 29, 2023 9:04 pm

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.

solo
Posts: 1228
Joined: Sun Feb 14, 2021 10:31 am

Re: User-specific connection

Post by solo » Sun Jan 29, 2023 10:47 pm

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
Otherwise, read How to assign user logoff scripts and AccountDisconnect.

jtenos
Posts: 2
Joined: Sun Jan 29, 2023 9:02 pm

Re: User-specific connection

Post by jtenos » Mon Jan 30, 2023 2:14 am

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

solo
Posts: 1228
Joined: Sun Feb 14, 2021 10:31 am

Re: User-specific connection

Post by solo » Mon Jan 30, 2023 2:33 am

jtenos wrote:
Mon Jan 30, 2023 2:14 am
I'm on Windows 11 Home - no group policy
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

Post Reply