Home All Groups Group Topic Archive Search About

Map drive based on OU location or group membership?

Author
8 Mar 2006 6:14 PM
BMoritz
Login script to map a folder based on the users OU or group membership?
This is kind of difficult to explain, but here is my best shot. This should
not be hard to do but I’m definitely not a scripting guru!

I have a shared folder:

\\domain.com\office\
    In that folder is a folder for each department i.e. \Sales \Service.
This folder needs to be mapped to the users in the corresponding group and or
OU.

The AD structure with the user accounts is setup much the same:

    Domain.com
            OU=Offce
                    sub.OU=sales
                    sub.OU=service

Every user in that OU is a member of a group called the department’s name. I
want to put a login script in group policy at the Office OU level so I don't
have to create one for each department. Ideally the login script would look
like:

    Net use F: domain.com\office\%DepartmentName%

How can I enumerate the user’s group membership or OU location to map the
drive?

Thanks for taking the time to read my question and for you help!
Brian

Author
8 Mar 2006 7:30 PM
Paul Williams [MVP]
You should instantiate an object that represents the authenticated user that
is logging on and then get that object's parent.  Then grab the ou attribute
and run that through a case statement that will map the drive defined as
constants.

--
Paul Williams
Microsoft MVP - Windows Server - Directory Services
http://www.msresource.net | http://forums.msresource.net