|03-22-2007, 08:17 PM||#1|
Join Date: Mar 2007
How to script mount volume based on AD groups
We run Windows 2003 server, and have user AD groups of "staff" and "students", of which both groups mount different shared volumes:
Staff - mounts volume "admin" and their Home Directories.
Students - mounts volume "resources" only.
I have the following login script which mounts volume "admin" for anyone who logs in to the iMac. Good thing is permission to the volume is based on their login. What i don't want is for the "admin" volume to appear in the students login, even though they can't see or access anything in there.
Tell application "Finder"
mount volume "smb://servername/sharedfolder"
How can i script it to mount volumes based on user groups?
Im not sure, but im pressuming something like
if group="staff" then try.. end try.
if group="student" then try.. end try.
Just can't seem to guess it right.
|03-23-2007, 05:46 PM||#2|
Join Date: May 2003
I don't think AppleScript has commands to deal with this, but you can call shell script commands from inside AppleScript. The 'groups' command returns up to the first 16 groups that a user is a member of. So if you do:
do shell script "groups"
Edit: Long-term, if someone in your organization is willing to spend the money for OS X Server, this can be a lot easier. You can set up a "magic triangle", where the client Macs are bound both to Active Directory and an Open Directory running on OS X Server. You create groups in OD for managed preferences (like login items) and nest AD groups inside them. Then this all happens automatically. It'll cost you at least a couple thousand dollars to get started, though.
|Display Modes||Rate This Thread|