keevern
asked on
Apple Script to mount drives based on users AD group membership
I have created an script that mounts drives users need but I have have to add each share in the script. I am looking for a script that looks at the users group membership and then mounts the share if they are a member of that group/share.
Thanks
Thanks
Login scripts execute as the root user and therefore "whoami" and "groups" return information for root. To get the actual user logging in you need to execute the following in your script:
username=`eval echo $1`.
Unfortunately, I am not sure what you could do for the group info.
username=`eval echo $1`.
Unfortunately, I am not sure what you could do for the group info.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Figured this out. You can also use.
set user_name to (short user name of (system info)) to get the local logged in user.
set user_name to (short user name of (system info)) to get the local logged in user.
https://www.experts-exchange.com/questions/27317949/Mount-network-drive-on-users-desktop-based-on-user-name.html
The command "whoami" gives your current username
The command "groups" will give you a list of groups you are a member of
You could SCAN the list of groups .. if it finds a match you can execute a SMB mount command.