| | | Question Mark Member Registered Member
Join Date: Apr 2007 Location: the few neurons in my brain... Italy!
Posts: 419
Certifications: CCNA, MCSA 2k3: Messaging, MCP, 70-285. WIP: 70-236, 70-293 | Wildcard character for "All objects in an OU" Exists?
It's quite tiring beating each time all the User Accounts when creating a new Group. Would be appreciate even a workaround.
TY |
| | Login/register to remove this advertisement. | | | Senior Member
Join Date: Mar 2007
Posts: 12,182
| You're just trying to add all the users of an OU to a group?
__________________ ''=~('(?{'.('[-@.^~'^'+_)@*^').'"'.('@.&@-@@<@~$@^~.@^_'^')@@/^)%[%^@/*^@%*}').',$/})') |
| | | Question Mark Member Registered Member
Join Date: Apr 2007 Location: the few neurons in my brain... Italy!
Posts: 419
Certifications: CCNA, MCSA 2k3: Messaging, MCP, 70-285. WIP: 70-236, 70-293 | Quote:
Originally Posted by dynamik You're just trying to add all the users of an OU to a group? | Yes, that exactly, ther's a way? |
| | | New Member Registered Member
Join Date: Jul 2006 Location: Chicago, IL
Posts: 3,376
Certifications: A+, Network+, MCSE:M 2003, MCITP: Enterprise Messaging Administrator, MCTS: OCS (Conf/Voice)/Hyper-V, Exchange MVP, B.S. | 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
|
| | | Question Mark Member Registered Member
Join Date: Apr 2007 Location: the few neurons in my brain... Italy!
Posts: 419
Certifications: CCNA, MCSA 2k3: Messaging, MCP, 70-285. WIP: 70-236, 70-293 | I'll try this solution (not very soon though), but if works you're a devil Royal. |
| | | New Member Registered Member
Join Date: Jul 2006 Location: Chicago, IL
Posts: 3,376
Certifications: A+, Network+, MCSE:M 2003, MCITP: Enterprise Messaging Administrator, MCTS: OCS (Conf/Voice)/Hyper-V, Exchange MVP, B.S. | Quote:
Originally Posted by rjbarlow 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
|
| | | Question Mark Member Registered Member
Join Date: Apr 2007 Location: the few neurons in my brain... Italy!
Posts: 419
Certifications: CCNA, MCSA 2k3: Messaging, MCP, 70-285. WIP: 70-236, 70-293 | Quote:
Originally Posted by royal 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. |
| |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT. The time now is 06:55 AM. | |