![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Add All User's in one OU to a group located in another OU HI Is theer any script at all to add all user's in one OU to a particular group. This group is located in another OU. Help Appreciated Gary |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Add All User's in one OU to a group located in another OU Gary wrote: Quote: > HI > > Is theer any script at all to add all user's in one OU to a particular > group. This group is located in another OU. > > Help Appreciated similar to: ========== ' Bind to OU object using Distinguished Name. Set objOU = GetObject("LDAP://ou=West,dc=MyDomain,dc=com") ' Bind to group object using Distinguished Name. Set objGroup = GetObject("LDAP://cn=Test Group,ou=East,dc=MyDomain,dc=com") ' Filter on user objects in OU. objOU.Filter = Array("user") ' Enumerate users in OU. For Each objUser In objGroup ' Check if user already a member of the group. If (objGroup.IsMember(objUser.AdsPath) = False) Then ' Add user to the group. objGroup.Add(objUser.AdsPath) End If Next -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Add All User's in one OU to a group located in another OU It's easy to do this using the Bulk Modify app from my website: http://www.wisesoft.co.uk/Products/P...ol/BulkModify/ Just query for all the users in that OU and append the group using the Bulk Modify dialog. Hope this helps, David http://www.wisesoft.co.uk (My personal website and a free resource for IT Professionals) "gbrown135" <gbrown135@xxxxxx> wrote in message news:1EE89EC7-DA83-41F1-9953-FCA377FDC619@xxxxxx Quote: > HI > > Is theer any script at all to add all user's in one OU to a particular > group. This group is located in another OU. > > Help Appreciated > > Gary |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Add All User's in one OU to a group located in another OU If you like command line stuff try this: dsquery user "<DN of source OU>" | dsmod group "<dn of group>" -addmbr -- Tim "Wiseman82" <nospam@xxxxxx> wrote in message news:CD73F199-E2C3-467A-9FCF-2245C427FAEC@xxxxxx Quote: > It's easy to do this using the Bulk Modify app from my website: > > http://www.wisesoft.co.uk/Products/P...ol/BulkModify/ > > Just query for all the users in that OU and append the group using the > Bulk Modify dialog. > > Hope this helps, > > David > http://www.wisesoft.co.uk > (My personal website and a free resource for IT Professionals) > > "gbrown135" <gbrown135@xxxxxx> wrote in message > news:1EE89EC7-DA83-41F1-9953-FCA377FDC619@xxxxxx Quote: >> HI >> >> Is theer any script at all to add all user's in one OU to a particular >> group. This group is located in another OU. >> >> Help Appreciated >> >> Gary |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| add user to group /group scope - Global /Group type - Security | PowerShell | |||
| Re: Enumerate User's AD Group Membership | VB Script | |||
| Re: Enumerate User's AD Group Membership | VB Script | |||
| Changing the user's 'name' | Vista General | |||
| Posting with another user's name | Vista General | |||