So, here's a snippit of the AppleScript I use to mount our network home folders on login. Usually it works just fine but for a few users it doesn't work. The reason it's not working is because when dscl command reads the SMBHome field the path is on a separate line:
**set loggedInUser to do shell script "whoami"
set ADHome to do shell script "dscl /Active Directory/WMS/All Domains -read /Users/" & loggedInUser & "| grep SMBHome: | cut -c 12- | sed 's/\\///g'"
try
do shell script "mkdir /Users/Shared/networkHome/" & loggedInUser & ""
on error
--continue
end try
try
do shell script "mount_smbfs //" & loggedInUser & "@" & ADHome & " /Users/Shared/networkHome/" & loggedInUser & ""
on error
--continue
end try**
If I just type the dscl command into terminal here's what I get for the SMBHome line(s):
SMBHome:
appselementary hird gradeusername
See how they're on separate lines? So in the script when the ADHome variable is set, it's just set to the blank line. How can I grab the second line?
- jamie