[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1506
  • Last Modified:

Mac Logon Hook per user????

I have a mobile lab of MacBook Pro's running OS X 10.7.4 that are being used in a K-8 school.  They are running the Golden Triangle (AD accounts with OD for MDX).  For their Junior High each student has their own AD account and we are using Network home folders so they can use any of the Mac's and still access their stuff.  Seems to be working well.  The lower grades are using class logons so the entire class logons with the same account.  These are also AD accounts with Network Home Folders.  We are running in to issues with applications not opening.  Specifically Safari and Google Chrome so far.  The application will bounce but then doesn't open.  I tracked the issue down to plist files in ~/Library/Application Support/...  If I delete them then it works but after a bit they become corrupt again and won't open.  My thought is that having 20+ machines all accessing the same folder is what is corrupting the files.  So I started looking for an alternative and I created a script that will allow me to create symbolic links to redirect only parts of the home folder (Desktop, Documents, Downloads...) leaving the Library and other folders local on the Macs.  The issue is that the only way I know to get this to run is to put it in as a login hook.  Which if I do that then it will run for ALL users that logon and I don't want that.  Is there a way to have it only run for certain user accounts?  Or is there a way to create a script that does a check if a user is part of an AD group and only continues if they are?
Or is there a different solution all together?
0
LiberatingInsight
Asked:
LiberatingInsight
  • 2
  • 2
  • 2
2 Solutions
 
jhyieslaCommented:
Have you tried putting your hook/script/whatever into the account(s) used by the lower grades as a Login Item in Users and Groups System Preferences?  If the hook resides in AD or the AD login script, perhaps you could write it as an Apple Script and then apply it to the appropriate user(s) as a Login Item as above.
0
 
LiberatingInsightAuthor Commented:
Is there a way to do that through the managed preferences from the OS X Server Workgroup Manager?  When I tried to look at the  Script option it said this could not be done on a per user basis.  Can I put a Script.sh file in the Items list?
0
 
jhyieslaCommented:
I do not know the first part as we don't use OS X server. I know that you can put an Apple Script .app file in the Login items. If the .sh is "executable" I would think the answer would be "yes".  Unless the Server can be used, it would be per Mac, which may or may not work in your environment.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
EdTechyCommented:
In answer to your last question, why not just create a local user and a shared network folder for those files that are common to the users. Have the share mount automatically at login so that each user has access to the same files that would typically be in the desktop and documents folders. Seems like it would create a real similar situation.
As far as your current approach, you could create a condition in your login script that would check for the username and only run when the appropriate user logs in.
0
 
EdTechyCommented:
Here is a little more useful info concerning the second part of my post.
Using a bash script called through a login hook, the following command will return the username of the one logging in.
`eval echo $1`

eg. CurrentUser=`eval echo $1`
0
 
LiberatingInsightAuthor Commented:
I created a script that just mounted the specific users shared folders as part of their profile.  However the customer ended up just having me create network accounts for the users so I never really got a chance to see how it worked in production.  Thanks for your help.
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now