Posted on 08-21-2012 03:48 AM
Hi All Guru
Next year our school will go for BYOD, students are allow to bring their own Mac Book to school and it is not bind to AD but they have to enroll with Casper. How could i write the script that will map the student share and home folder share. I am not familiar with apple script at all.
These is the example scenario will be like:
A year 7 student and his username is 1234. In AD, he is in a permission group call Year 7. In the windows share server there is a share folder call serveryear7_share$.
Also have a home share drive call serverstudent_home$username (serverstudent_home$1234).
So when that year 7 student log on to his own Mac Book (local username), there is a mapping script on the desktop, and if he want to map the network share, he just need to run the mapping script.
So the script will prompt him the username and password. Then the script will take his username and password and check against the AD authentication to see which permission group he is in. If he is in year 7, the script will map serveryear7_share$ and serverstudent_home$username.
This script will apply through year 7 - 12
Hope someone could help about this.
Posted on 08-21-2012 03:54 AM
Hi,
I haven't the whole answer... But you should be able to adapt the ApplsScript app I have linked elbow for this.
[url]http://macmule.com/2011/09/08/how-to-map-drives-printers-based-on-ad-group-membership-on-osx/url]
Posted on 08-21-2012 04:34 AM
Hi Bentoms
Thanks for the link, so do i need to create 3 scripts? or come all in 1 script.
Posted on 08-21-2012 04:45 AM
You could just go with the AppleScript app & a Config profile to open it at login (this replaces the launch agent).
If you using it on 10.6 or are deploying printers then you may need the 3rd script.
Posted on 08-23-2012 01:43 AM
I am planning to use config profile instead of script. Do you have a example of mapping smb share at login in config profiles?
Thank
Posted on 12-15-2016 01:29 PM
is this available for OD?
Posted on 12-15-2016 04:30 PM
Also if you just have the script attempt to mount the drive without credentials using an applescript call to the finder macOS should automatically prompt for credentials if it needs them.
Try something like this as a Self Service policy rather than a desktop icon, if you require authentication for Self Service it will populate the user i.e. $3 automatically, and you can have a seperate policy for each year scoped based on the members of that year with a first optional field for the script set to the year i.e. $4
CU=$3
YEAR=$4
Share_Path=$(echo "smb://server/year${YEAR}_share$")
Home_Path=$(echo "smb://server/student_home$/${CU}")
echo $Share_Path
echo $Home_Path
osascript<<END
tell application "Finder"
mount volume "$Share_Path"
mount volume "$Home_Path"
end tell
END