I have a suite of 14 iMacs and 1 MacBook Pro to deploy.
I have enrolled them into Profile Manager and configured payloads to set up the Macs as I want them. They join Active Directory fine by naming each Mac under System Preferences/Sharing then enrolling them - the Directory configuration does the rest and puts them in the correct Organisational Unit. I am then able to sign in using AD accounts and access file shares.
Network Mounts in locations other than the Desktop
Network Mounts configured under Login Items only appear on the desktop so users are unable to access them via the File > Save dialog in applications.
Manually dragging shares from the desktop into Favourites on Finder's sidebar makes them accessible via File > Open and Save but I can't expect users to do this.
I attempted to add the shares by creating a Custom Setting payload and uploading com.apple.sidebarlists.plist from a user profile set up with the shares under Favourites, this didn't work.
My next thought was creating a bash script to map the drives and create links under the user's Documents folder, useful as this is the default folder for File > Open/Save.
#!/bin/bash
mkdir /Volumes/Temporary
mkdir /Volumes/Resources
mount_smbfs "smb://fs1/Temporary" /Volumes/Temporary
ln -s /Volumes/Temporary ~/Documents
mount_smbfs "smb://fs1/Resources" /Volumes/Resources
ln -s /Volumes/Resources ~/Documents
This runs fine when executed from the Terminal using sh Login_Students.sh
Under Profile Manager's Login Window options I uploaded the script and set up a Custom Settings payload as advised, setting ~root/Library/Preferences/com.apple.loginwindow.plist's EnableMCXLoginScripts to true and MCXScriptTrust to our domain name, I also tried anonymous and authenticated.
The script does not run on either admin or standard user accounts.
I created a file com.mapdrives.plist under /Library/LaunchAgents:
Label
com.mapdrives.plist
Program
/Users/Shared/Login_Students.sh
RunAtLoad
This executes the Login_Students.sh script to map drives saved in /Users/Shared and works fine for admin users but not for standard users - I've made sure that the file has execute permissions using chmod +X and chmodded it to 777 as a test so all users have full access to it - still no joy, check the permissions in Finder and can see no issue there.
Image Deployment
Created a NetRestore image on an iMac patched up to date and with Microsoft Office, Apple Pages, Numbers, Keynote and Garageband (with all samples and instruments) on it. It deploys fine to other iMacs but occasionally displays an error message when shutting down on a MacBook Pro - "You need to restart your computer. Hold down the Power button for several seconds or press the Restart button."
Created a default user profile before taking an image so that first run guides for applications do not appear nor does the registration details window on Office applications. I did the following:
rm -rf /Users/DEFAULT/Library/Caches/*
rm -rf /Users/DEFAULT/Library/Keychains/login.keychain
rm -rf /Users/DEFAULT/Library/Preferences/SDMHelpData
rm -rf /Users/DEFAULT/Library/Saved\ Application\ State/*
rm -rf /System/Library/User\ Template/English.lproj
ditto -V /Users/DEFAULT /System/Library/User\ Template/English.lproj/
chown -R root:wheel /System/Library/User\ Template/English.lproj/
du -sh /System/Library/User\ Template/English.lproj
When a user logs in for the first time and their profile is created some items in Finder's sidebar such as Documents pointed to the account I created the default user profile from so I removed them all apart from the home folder and Applications.
All folders in the user profile other than Public have their ownership set to the DEFAULT user so are inaccessible.