Posted on 06-22-2024 01:11 AM
Hello everyone,
I've been searching high and low for a way to be able to update the username in a VPN profile based on the user who is logged in. We are currently using a configuration profile which works only when only 1 person uses a Macbook but as soon as a 2nd user logs in, the username of the 1st user remains in the VPN settings when the 2nd user tries to connect.
Has anyone managed to find a way around this?
Posted on 06-24-2024 06:19 AM
currentUser=$(who | awk '/console/{print $1}')
You could try using this command to pull the currently logged in user, then add it to your script, then create a launch daemon/agent to run on login.
Posted on 06-24-2024 09:29 PM
Thanks. I know how to get the username, it's the actual updating of the VPN profile with that username that's the problem. There seems to be no easy way to do it.