Hi everyone, we're trying to auto mount some SMB shares on user login using Jamf Policies but although I can get a script to work having a bit of trouble getting it to work in a user-specific way.
Our share target is dfsrootMacHomesuser1 (where user1 is the username of whoever logs in). We don't use Home Folders in our AD and don't want to modify it to add them in case of unexpected side-effects for our Windows machines so the standard Jamf behaviour where it auto mounts the Home Folder path doesn't work for our use case.
So far I've found two scripts on my travels that seem popular:
https://www.jamf.com/jamf-nation/discussions/27402/mount-network-share
https://www.jamf.com/jamf-nation/third-party-products/files/476/mountnetworkshare-sh-mount-a-network-share
I've had more luck with the first one, which maps correctly if I put a sample user's full path into the Script Parameter #4 but not if I try to use a variable in there. As I understand I should be able to use $3 to get the logged-in username for a Policy that runs at User Login? However that doesn't seem to work.
Have also tried hardcoding that path into the script e.g.
dfsrootMacHomes$3
However the script seems to take that a bit too literally and maps to the path including $3, rather than replacing it with the currently logged in user's name,
Has anyone found the correct syntax mix to get dynamic paths working with a User Login Policy or are we trying to do something that doesn't work?