Announcement

Collapse
No announcement yet.

Problem with map drives login script

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with map drives login script

    I have a problem with a login script. It is meant to map drives based upon what groups a user is a member of.

    The script is shown below, and is filtered to the Authenticated Users group. As it stand only those that are members of either A or B teams should get a drive mapping. It does map the drives for users that are a member of either team, but it also maps both drives for anyone that is a member of the Administrator group and none of the Admins are members of these groups.

    Any ideas?

    domain = "Domainname" ' set domain name
    set objUser = GetObject("WinNT://" & domain & "/" & strUser) 'get user object
    set objWks = GetObject("WinNT://" & domain & "/" & strWks) ' get computer object

    ' Mappings for A Team
    group = "SG - A Team" 'set group name
    set objGroupRPC = GetObject("WinNT://" & domain & "/" & group)
    If objGroupRPC.IsMember(objUser.ADsPath) Then
    'WScript.echo "Member of Group"
    Call MapDrive ("m:", "\\Fileshare\data\Ateam") 'For A Team
    End If

    ' Mappings for B Team
    group = "SG - B Team" 'set group name
    set objGroupRPC = GetObject("WinNT://" & domain & "/" & group)
    If objGroupRPC.IsMember(objUser.ADsPath) Then
    'WScript.echo "Member of Group"
    Call MapDrive ("s:", "\\fileshare\data\Bteam") 'For B Team
    End If

  • #2
    hi,

    don't know what is wrong with your script, looks ok to me. We do a similar thing using a program called ifmember which u can download from microsoft. U need to put ifmember in your netlogon folder and then can assign drives by groups easily. eg :-

    :Personnel
    ifmember G_Personnel
    if not errorlevel 1 goto Finance
    net use g: \\server1\Personnel

    set this up for each of your groups and you're away!!

    Comment


    • #3
      Re: Problem with map drives login script

      Are there any groups which are nested members of your two groups? If so, if you walk up the "chain" are the administrator users members of any groups (indirectly) that might be inherited by these two groups? Just a thought. I don't use VBscript for loginscripts, I use KixTart InGroup() function, which is very similar, but it works very well for my needs.

      Comment


      • #4
        Re: Problem with map drives login script

        No groups are nested.

        I've just found out that other users are not only being mapped to this drive, even though they shouldn't be, but they can also access the folders, even though the permissions are restricted.

        Comment

        Working...
        X