• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • 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.
0
quaybj
Asked:
quaybj
1 Solution
 
oBdACommented:
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:

====8<----[logon.cmd]----
@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
:Endgroup01

ifmember.exe YourDomain\Group02
if not errorlevel 1 goto EndGroup02
if exist Y: net use X: /delete >NUL
net use Y: \\SomeServer\SomeOtherShare
:Endgroup02
====8<----[logon.cmd]----
0
 
quaybjAuthor Commented:
Thanks oBda, that worked just fine!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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