1. prasanna 6 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. stein 5 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. Dave Hauss 1 year 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


  4. Israel 1 year ago

    This is great, but Im having an issue setting up an login item for domain users. I used Script Editor to create an alert message that will pop up when user login. I am using Profile manager to deploy it and run it.. I save the script as an app and placed it in the Applications folder.

    The message I want come up but only for local accounts, domain accounts fail to open it and when i check the apps folder, the application states that it is damaged or not complete. Unsure why when it runs under any local account just fine.

    Any ideas?


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 - 2017

Log in with your credentials


Forgot your details?

Create Account