Copy Group Membership From One Group to Another

Copies the group membership from one group to another.

3.1 Star
Add to favorites
Active Directory
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Unwilling error
    1 Posts | Last post October 24, 2013
    • Hi,
      When I tried the script, it sad 'The server is unwilling to process the request.'
      With error code: 80072035
      When I debug the script, this error happened only in Add method.
      Then how can I copy about 100 members from one group to another?
      Please help me!
  • How to check for existing members in the destination group?
    1 Posts | Last post January 20, 2012
    • Leaving aside the fact that the script should revised completely...
      In order to avoid conflicts with objDGroup.Add() I'd check for existing membership with objDGroup.IsMember() first:
         For Each objMember In objGroup.Members
            strUserADsPath = "LDAP://" & objMember.distinguishedName
            If (objDGroup.IsMember(strUserADsPath) = True) Then
               Wscript.Echo "Current user is a member of the group."
            End If
      Another approach is to remove all members from the destination group before adding/copying the members from the source group. But, using this way you would "mirror" the group memberships from the source to destination group.
  • Large Active Directory Groups
    1 Posts | Last post December 31, 2011
    • Hello, This script works fine, but if i try to copy members of a large group (1000+)it doesnt copy all the members. Can you please modify the script so that it can retrieve all the members in a large group.
      Thank you.
  • Quick and dirty script
    3 Posts | Last post March 22, 2010
    • I'ld not use that script without modifications. Is defines a dictionary but does not use is and is simply copies the member, but dows not cleanup the target. It uses as "function" but it is only called once.
      Not a good sample for coding simple functions.
      Bi it should work.
    • Ok here a shorter version (does not remove objects from the target membership list)
      strSGroupDN = "CN=Source Group,OU=Users,DC=NWTraders,DC=com"
      strDGroupDN = "CN=Destination Group,OU=Users,DC=NWTraders,DC=com"
      set objDGroup = GetObject("LDAP://" 
    • Hi. Thanks for the script. after running, i get the message "(17, 8) (null): The server is unwilling to process the request." Any Ideas ? :)