Go Back   The macosxhints Forums > OS X Help Requests > Networking

Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Old 03-22-2007, 08:17 PM   #1
Join Date: Mar 2007
Posts: 4
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"
end try
end tell

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.

Many thanks.
shanghui is offline   Reply With Quote
Old 03-23-2007, 05:46 PM   #2
Join Date: May 2003
Posts: 4,272
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"
...you get a list of groups, which you can search for "staff". Then it's just an if/else situation.

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.
giskard22 is offline   Reply With Quote
Old 03-25-2007, 02:11 AM   #3
Join Date: Mar 2007
Posts: 4
Giskard22, noted your suggestion. OSX Server would be ideal, will look into that.

Thank you.
shanghui is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 03:32 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.