map drives based on group membership / AD description path

Discussion in 'Windows Small Business Server' started by Jack, Sep 28, 2005.

  1. Jack

    Jack Guest

    I once saw a pretty slick way to map drives based on group membership. I
    believe the logon script used the ifmember cmd to determine what groups user
    belonged to. It would then map the drive according to what was in the
    description field for the group in AD - ie ["*:\\servername\share"] would map
    user to next available drive. However the same description line without
    wildcard ["m:\\servername\share"] would map to letter m. This seemed to work
    very well. If I didnt want user to have access, i would remove user - file
    permissions wouldnt permit user getting in. And if user had permission - a
    drive would automatically be mapped.
    I am wanting to incorporate something very similar. Any samples, links would
    be greatly appreciated.

    Jack, Sep 28, 2005
    1. Advertisements

  2. Jack

    A. Feiner Guest

    I use KIX32 for my batch file, it looks something like this:
    IF InGroup("Acctmgr")
    USE P: \\teacup\maindir\reports
    USE H: \\teacup\maindir\eaglePro
    Use R: \\teacup\maindir\acctg
    You can go further and
    IF InGroup("Accounting")or @userid = "lspencer"
    USE P: \\teacup\maindir\reports
    USE H: \\teacup\maindir\eaglePro
    Use R: \\teacup\maindir\acctg
    redirectoutput ("r:\logon.txt",0)
    If RedirectOutput ("r:\logon.txt")=0
    [email protected]",in,"[email protected]","[email protected]","[email protected] (that's to capture login time
    for reporting purposes)
    A. Feiner, Sep 28, 2005
    1. Advertisements

  3. Jack

    A. Feiner Guest

    The IfMember works with conditions, here is how to test

    IfMember "Domain Admins"
    If ERRORLEVEL 1 exit
    rem Notice that the syntax here is the opposite to normal in that
    rem %ERRORLEVEL% = 1 = Success
    rem with most other NT commands %ERRORLEVEL% = 1 = Fail/Error
    net send %computername% Boo!

    IfMember "Accounting"
    net use B: \\server\share
    A. Feiner, Sep 28, 2005
  4. Jack

    Jack Guest


    Thanks for your reply. What I am looking for is script that will
    automatically map drive based on 1) users in group 2) what is listed in
    global group description field(ie [*:\\servername\share] or to specify
    particular drive [G:\\servername\share]

    That way I will not have script each time a drive has either moved or drive
    letter is different.

    Any ideas?

    Jack, Oct 5, 2005
  5. Jack

    A. Feiner Guest


    Then you can use either one they are both suitable. Look at:

    Amnon Feiner
    Solid Wood & Stone PC Peripherals.
    A. Feiner, Oct 5, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.