alfatec Posted June 15, 2015 Posted June 15, 2015 Hi, Has anybody got a good example of a script that I can use to map a windows home drive to the mac desktop on login. Using Yosemite workstations bound to active directory and managed through Yosemite profile manager. Can mount drive to users folders by going to 'connect to server' but cannot get a script working. Any samples would be much appreciated.
Mark182 Posted June 15, 2015 Posted June 15, 2015 We use profile manager > log in items > SMB://path/share
alfatec Posted June 15, 2015 Author Posted June 15, 2015 Yes we do that as well for the shared drives but how do you map an individual users folder to the desktop?
alfatec Posted June 17, 2015 Author Posted June 17, 2015 OK Managed to find a script but have run into a small problem, The script is basically as below: tell application "System Events" tell current user set fn to full name try mount volume "smb://server/shared area/" & fn end try end tell end tell The problem I have is that it will only work if the username of the logged in user is the same as the Display name in Active Directory. e.g. Staff user atest login name is atest but their display name is A Test - Head of Maths. This will not work. The only way I can get it to work is to change the display name to be the same as the login name: atest. But this now means that it affects the email display details. Anybody know if I can change the script so that it reads from the username and not the display name.
dayzd Posted June 17, 2015 Posted June 17, 2015 Does set userName to short user name of (system info) or set userName to do shell script "whoami" from this Apple discussion thread: "Find username of current account (AppleScript)" help? I've not tested it, but I imagine you'd end up with something like this: tell application "System Events" set userName to short user name of (system info) try mount volume "smb://server/shared area/" & userName end try end tell
alfatec Posted June 17, 2015 Author Posted June 17, 2015 Hi Dayzd, Many thanks for your help on that. It worked a treat. Been working on this for ages but now resolved.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now