• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

Mapping different drives for different users in Terminal server

I need to map several drives for domain users logging into Terminal server on Windows 2003.  There are three groups and all of the users in those groups do not get the same drive mappings.  I could just map all the drives for all the users, and just let the application of permissions keep some users out of some drives.  I would rather not let the users who do not have access to some folders even see the mappings. This works fine on the domain, I am just using different logon scripts (very small shop - 12 users). How can this be done in Terminal Server?  I saw the ifmember.exe utility from the Resource Kit, but have not been successful at making it work.
1 Solution
ifmember should work; the one thing to note is that it returns errorlevel 1 if the user *is* group member.
Assuming you're using a the logon script from the user's profile, simply put ifmember.exe into the netlogon share as well.
Something like that should work:

@echo off
net use /persistent:no
:: *** Map the drives according to group membership:
ifmember.exe YourDomain\Group01
if not errorlevel 1 goto EndGroup01
if exist X: net use X: /delete >NUL
net use X: \\SomeServer\SomeShare

ifmember.exe YourDomain\Group02
if not errorlevel 1 goto EndGroup02
if exist Y: net use X: /delete >NUL
net use Y: \\SomeServer\SomeOtherShare
quaybjAuthor Commented:
Thanks oBda, that worked just fine!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now