?
Solved

Copy Activie Driectory Groups

Posted on 2005-03-03
7
Medium Priority
?
162 Views
Last Modified: 2010-04-19
I am looking for a script or a free tool that will allow me to copy the groups a users is a member of to another user.

User A belongs to gGroup1, gGroup2

User B needs to have those same attributes.


Obviously with only a couple users this would be easy but I need to do this across a few hundred users.


Any help?

T
0
Comment
Question by:tmack
  • 4
  • 3
7 Comments
 
LVL 57

Accepted Solution

by:
Mike Kline earned 1500 total points
ID: 13454227
If you need to add the same groups to a few hundred users then there are ways to do that but to directly do a copy like this I'm not sure of.

I'll let you know if I come up with anything.

Thanks
Mike
0
 
LVL 4

Author Comment

by:tmack
ID: 13454615
yea..essentially what is happening here is I am using ADMT to migrate users from another forest to our forest and then I have exisiting accounts (I know a big mess here but I have to deal) that are memebers of alot of different groups. We are running a parallel AD forest here so once i get the old account migrated over I need to copy what group memberships they have in our forest to their migrated accounts. I hope I am explaining it right.

T
0
 
LVL 57

Expert Comment

by:Mike Kline
ID: 13455052
Are you in native mode, if so you can use SID History when you migrate them over and that will help you.   There should be a migrate Sidhistory setting.  That way the migrated account will still have the old SID and can still access resources in the old domain.  

Thanks
Mike
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Author Comment

by:tmack
ID: 13455245
we are running at a 2003 functional level. I am aware of the SidHist attribute and this is not what I am needing. the account are migrated. Just we have a paralell environment thus they have 2 sets of accounts in our infrastructure. So what I need is to take or copy group memberships from one account and add them to another so I dont have to do this manually.

So this is what I have:

Migrated USERA account with all their original group memebrships
New parallel account USERB in our domain

I need to take groups that USERB has and copy them or append it to the USERA account.

I hope that makes sence.
0
 
LVL 57

Expert Comment

by:Mike Kline
ID: 13457974
It makes sense... I don't know how to do it :)   I'll look around and let you know if I find anything.

Thanks
Mike
0
 
LVL 4

Author Comment

by:tmack
ID: 13460030
thanks..
0
 
LVL 4

Author Comment

by:tmack
ID: 13499359
got this figured out...here you go incase anyone needs it.

Domain = "mydomain.net"             

Set Args = wscript.Arguments
If Args.Count() < 2 Then
    wscript.echo "Usage: cscript.exe //nologo copy_groups.vbs <source_username> <target_username>"
Else
    source_username = Args.item(0)
    target_username = Args.item(1)
End If

Set oUser = GetObject("WinNT://" & Domain & "/" & source_username & ",user")
For each gGroup in oUser.Groups
      on error resume next
      wscript.echo gGroup.Name
      gGroup.Add ("WinNT://" & Domain & "/" & target_username & ",user")
Next
Set gGroup=Nothing
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question