Hello Johan,
Check out Marcins answer:
----------------------------------------------------------------------
Is this what you are looking for?
Set oGroup1 =
GetObject("LDAP://cn=Group1,ou=Groups,dc=change-my-name,dc=local")
Set oGroup2 =
GetObject("LDAP://cn=Group2,ou=Groups,dc=change-my-name,dc=local")
For Each oUser in oGroup1.Members
oGroup2.Add(oUser.ADsPath)
Next
hth
Marcin
----------------------------------------------------------------------
From:
http://forums.techarena.in/active-directory/900625.htm
Best regards
Meinolf Weber
Disclaimer: This posting is provided "AS IS" with no warranties, and confers
no rights.
** Please do NOT email, only reply to Newsgroups
** HELP us help YOU!!!
http://www.blakjak.demon.co.uk/mul_crss.htm
> Is it possible to copy(not move) users from one group to a different
> group
> through a script? am creating some new sites in AD and i dont want to
> do the
> copying by hand. I did find the following script(heyscriptingguy):
> Const ADS_GROUP_TYPE_GLOBAL_GROUP = &H2
> Set objOU = GetObject("LDAP://OU=Finance, dc=fabrikam, dc=com")
> Set objOldGroup = GetObject("LDAP://CN=Finance Managers, ou=Finance,
> dc=fabrikam, dc=com")
> Set objNewGroup = objOU.Create("Group", "Finance Department")
> objNewGroup.sAMAccountName = "financedept" objNewGroup.groupType =
> ADS_GROUP_TYPE_GLOBAL_GROUP objNewGroup.Set Info
>
> For Each objUser in objOldGroup.Member
> objNewGroup.Add "LDAP://" & objUser
> Next
> but that script is moving from 1 group to a group thats also being
> created. My destinationgroups already exist
>