Automount SMB Network Shares once Cisco Anyconnect VPN client connects

New Contributor

I wonder if anyone can help. We are new users of Jamf and are looking for a solution to mounting SMB network drives automatically when the device is connected through Cisco Anyconnect VPN Client.

We have two scripts configured that mount a users 'Personal' network location SMB share and a 'Shared' network drive. We have a JAMF policy set to Ongoing, with the trigger as login, so works well when the Mac's are connected to our network for users logging in.

However, when the device is off site or connected to a different network, the user logs in and Finder returns an error 'There was a problem connecting to the server' as expected. What we are looking to do is automate the connection to these drives once the user has logged into the Cisco AnyConnect VPN client, and make the SMB mounts appear on the users desktop, like they do when connected on site.

Does anyone know a solution for this?


Valued Contributor

If you also have a need for better management of users' AD password Apple Enterprise Connect or Nomad can manage auto mount of shares with AD credentials. What credentials are you using now?

New Contributor III

Write a script to mount folders with a check to only run when you can ping the fileserver, then have a launchdaemon to run on Network State Change, then trigger the script. You should package this and install on computers.

Protip, use configuration profiles with folders, and servers and have your script read the Configuration profile for which folders to mount.