Wildcard character for "All objects in an OU"

rjbarlowrjbarlow Member Posts: 411
Exists?
It's quite tiring beating each time all the User Accounts when creating a new Group. Would be appreciate even a workaround.

TY
Pork 3
Maindrian's music

WIP: 70-236, 70-293 and MCSE.

Comments

  • dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    You're just trying to add all the users of an OU to a group?
  • rjbarlowrjbarlow Member Posts: 411
    dynamik wrote: »
    You're just trying to add all the users of an OU to a group?
    Yes, that exactly, ther's a way?
    Pork 3
    Maindrian's music

    WIP: 70-236, 70-293 and MCSE.
  • royalroyal Member Posts: 3,352 ■■■■□□□□□□
    1. Install PowerShell
    2. Install the QAD Snapin by reading the following: Shariq Sheikh | Port 389 Blog Archive Put Powershell and QAD cmdlets together to become a lazier (yet smarter) System Admin
    3. Obtain the Distinguished Name for the OU
    4. Obtain the Distinguished Name for the Group
    5. Run the following script: Get-QADUser -SearchRoot "DN of OU" | foreach-object { Add-QADGroupMember -identity "DN of Group" -member $_ }

    Example -
    DN of the OU: OU=Lab,OU=Root,DC=shudnow,DC=net
    DN of the Group: CN=LabGroup,OU=Root,DC=shudnow,DC=net

    The command would appear as:
    Get-QADUser -SearchRoot "OU=Lab,OU=Root,DC=shudnow,DC=net" | foreach-object { Add-QADGroupMember -identity "CN=LabGroup,OU=Root,DC=shudnow,DC=net" -member $_ }

    You can obtain the DN using ADSIEdit or LDP.
    “For success, attitude is equally as important as ability.” - Harry F. Banks
  • rjbarlowrjbarlow Member Posts: 411
    I'll try this solution (not very soon though), but if works you're a devil Royal.
    Pork 3
    Maindrian's music

    WIP: 70-236, 70-293 and MCSE.
  • royalroyal Member Posts: 3,352 ■■■■□□□□□□
    rjbarlow wrote: »
    I'll try this solution (not very soon though), but if works you're a devil Royal.

    After I wrote the cmdlet, I tested it in my lab to see if it would work and low and behold, it did. :)
    “For success, attitude is equally as important as ability.” - Harry F. Banks
  • rjbarlowrjbarlow Member Posts: 411
    royal wrote: »
    After I wrote the cmdlet, I tested it in my lab to see if it would work and low and behold, it did. :)
    I knew it for sure, it was just an academic doubt.
    Pork 3
    Maindrian's music

    WIP: 70-236, 70-293 and MCSE.
Sign In or Register to comment.