Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to populate Global groups?

Status
Not open for further replies.
Jan 12, 2004
5
0
0
US
I need to populate some groups with users in a csv and hoping someone has some experience here! My initial thought was to use net group from the DC but i don't know how to put it in a loop to read the file. VBscript would probably be easier since it doesn't have to run on the DC.
Anyone have any thoughts?
Thanks in advance!
 
Here's the function I use... it requires distinguished names...

Code:
'******************************************************************************
' Add members to group.  The array should be an array of distinguished names
'******************************************************************************
Sub AddMembersToGroup(pMembers, newGroup)

	theMembers = Array()
	ReDim theMembers(pMembers.Count - 1)

	Dim idx:idx = 0
	
	For Each idxMember in pMembers
		theMembers(idx) = pMembers.Item(idxMember)
		idx = idx + 1
	Next
	
	newGroup.PutEx ADS_PROPERTY_APPEND, "Member", theMembers
	newGroup.SetInfo

	
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top