Mapping different drives for different users in Terminal server

Posted on 2005-04-08
Last Modified: 2011-09-20
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.
Question by:quaybj
    LVL 82

    Accepted 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

    Author Comment

    Thanks oBda, that worked just fine!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    I have never ceased to be amazed how many problems you can encounter on a fresh install of a Windows operating system.  This is certainly case in point& Unable to complete ANY MSI installation.  This means Windows Updates are failing and I can't …
    A quick step-by-step overview of installing and configuring Carbonite Server Backup.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now