Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - nest group to multiple groups in ou

Reply
 
Old 08-21-2008   #1 (permalink)
Randy


 
 

nest group to multiple groups in ou

Does anyone have a script that will nest a global group to all the
groups in an ou?

My System SpecsSystem Spec
Old 08-21-2008   #2 (permalink)
Richard Mueller [MVP]


 
 

Re: nest group to multiple groups in ou

Randy wrote:
Quote:

> Does anyone have a script that will nest a global group to all the
> groups in an ou?
If you mean that you want all groups in the OU to be members of a specified
group, the program could be:
==========
' Bind to the global group, using the Distinguished Name of the group.
Set objGlobalGroup =
GetObject("LDAP://cn=TestGroup,ou=West,dc=MyDomain,dc=com")

' Bind to the OU object, using the Distinguished Name of the OU.
Set objOU = GetObject("LDAP://ou=East,dc=MyDomain,dc=com")

' Filter on group objects.
objOU.Filter = Array("group")

' Enumerate all groups in the OU.
For Each objGroup In objOU
' Check if the group is already a member.
If (objGlobalGroup.IsMember(objGroup.AdsPath) = False) Then
' Add the group to the global group.
objGlobalGroup.Add(objGroup.AdsPath)
End If
Next

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
add user to group /group scope - Global /Group type - Security PowerShell
Can't nest WLM's categories like OE's groups? Live Mail
how do you nest groups cross domains?? I'm fairly new at this. VB Script
Exporting full list of members of a group (including groups andexternal accounts), but filtered and sorted VB Script
Why can't I group contacts into specific groups to expedite emails? Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46