Announcement

Collapse
No announcement yet.

VB Active Directory Nested Groups

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

  • VB Active Directory Nested Groups

    Hi,

    I have the following script which maps drives during logon based on group membership (which works perfectly), but I need to amend it so that it returns the parent group of a user. For example, Joe Bloggs is a member of Group A, and Group A is a member of Group 1. I need Group 1 to be returned and not Group A.

    Code:
    colGroup = CurrentUser.memberOf 
    If IsEmpty(colGroup) Then 
        strGroup = "" 
    ElseIf TypeName(colGroup) = "String" Then 
        strGroup = LCase(colGroup) 
    Else 
        strGroup = LCase(Join(colGroup)) 
    End If 
    
    If InStr(strGroup, Administrators) Then 
        objNetwork.MapNetworkDrive "I:", "\\Apps-01\Applications" 
        objNetwork.MapNetworkDrive "L:", "\\Apps-01\Management Tools" 
        objNetwork.MapNetworkDrive "N:", "\\Apps-01\Workstation Build" 
        objNetwork.MapNetworkDrive "U:", "\\Storage-01\Users" 
        objNetwork.MapNetworkDrive "V:", "\\Storage-01\Profiles" 
    End If
    Thanks/...

  • #2
    Re: VB Active Directory Nested Groups

    I believe one of those good at scripting (Rems I think but I may be wrong) did something similar recently.
    They used a function called IsMember by Richard L. Mueller.
    I don't know anything about (you or your) computers.
    Research/test for yourself when listening to free advice.

    Comment

    Working...
    X