?
Solved

Copy Activie Driectory Groups

Posted on 2005-03-03
7
Medium Priority
?
160 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

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…
Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

765 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