locked
Nest Security group to another !!! RRS feed

  • Question

  • HI ,

         I'm  working  on  some automation  process & need to  know the possibility  of Nesting a  security  group  to  another  via a VBS. 

    Thanks  in advance,

    RGDS,

     


    G
    Saturday, June 25, 2011 9:57 PM

Answers

  • You can make one group a member of another using a VBScript program. I would use the Add method of the parent group object. You can first check if the second group is already a member using the IsMember method. For example:

     

    ' Bind to parent group.
    Set objGroup1 = GetObject("LDAP://cn=Group1,ou=West,dc=MyDomain,dc=com")

    ' Bind to child group, to be made a member of parent.
    Set objGroup2 = GetObject("LDAP://cn=Group2,ou=East,dc=MyDomain,dc=com")

    ' Make sure child group is not already a member.
    If (objGroup1.IsMember(objGroup2.ADsPath) = False) Then
        ' Add the child group to the parent group.
        objGroup1.Add(objGroup2.ADsPath)
    End If

     


    Richard Mueller - MVP Directory Services
    • Proposed as answer by A.Hultgren Sunday, June 26, 2011 5:19 PM
    • Marked as answer by IamMred Tuesday, June 28, 2011 7:43 AM
    Saturday, June 25, 2011 11:42 PM