Active Directory login scripts in Mac OS X – Part 1: Basic Approaches

  1. avatar
    prasanna 5 years ago

    I tried to execute a shell script while logon using login hook. It is working fine for root user. Is it possible to execute the shell script using non-root user.

    I tried with the login items by adding the shell script, but no luck.

    Is there any way to execute shell scripts while logon by non-root users

  2. avatar
    stein 4 years ago

    I discovered that the hook running as root causes problems also. Primarily it changes the permisions and the user can’t see the folder on the desktop any longer because it is only available to root.

    And of course I don’t want to log into the server as root.

    According to this page

    the short username is in $1 (you have to click more near the top to see it though)

    So I tried a script like
    su – $1
    mkdir /Users/$txtUSER/Desktop/Fdrive
    mount_smbfs //MY_SERVER/sys /Users/$txtUSER/Desktop/Fdrive
    mkdir /Users/$txtUSER/Desktop/Hdrive
    mount_smbfs //MY_SERVER/home/$txtUSER /Users/$txtUSER/Desktop/Hdrive
    KillAll Terminal

    This script will run (without the su -$1) fine when placed in the users login items.

    Note: To get the shortcuts to show on the desktop the user will need to go to finder -> preferences and check connected servers.

    Hope this helps someone else. Wished I could figure out how to switch users to run this command from the hook.

  3. avatar
    Dave Hauss 3 months ago

    I am searching for a login script of OSX EL CAPITAN so that when a user logs into the MAC using the OSX server and profile manager, the ACTIVE DIRECTORY home folder is automatically mapped to the MAC home folder (documents, etc).  Is there a script somewhere I can use?


    Thanks .. Dave


Leave a reply

Your email address will not be published. Required fields are marked *



Please ask IT administration questions in the forum. Any other messages are welcome.

© 4sysops 2006 - 2016

Log in with your credentials


Forgot your details?

Create Account