• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2726
  • Last Modified:

Automatically Join Computers in an OU to a security group

Hello, in our domain we have multiple offices across the country. Each of these offices has it own OU, eg London, Manchester, Liverpool etc.

Each Citys OU contains child OUs for objects eg Users, Laptops, Desktops, Security Groups, Distribution Groups etc

I have a security group that is for the whole of the domain, what I want to do is automatically make any laptop in every city City a member of the security group.

Is there a way to do this? I would mind a powershell script running every so often. ut it would be nice to be able to put in some sort of policy that forces a member of an OU into a group.
0
infradatel
Asked:
infradatel
  • 4
  • 3
  • 2
2 Solutions
 
Joseph MoodyBlogger and wearer of all hats.Commented:
Try this:

Get-QADComputer -SearchRoot "OU=NAMEOF OU,OU=NAMEOFCITYOU,DC=Test,DC=local" | Add-QADGroupMember "TEST\GROUPNAME"

You will need to specify the search root to each laptop OU. You will also need the Quest AD CMDLets.

http://www.quest.com/powershell/activeroles-server.aspx
0
 
Joseph MoodyBlogger and wearer of all hats.Commented:
Set it up as a scheduled task and you are good to go!
0
 
infradatelAuthor Commented:
Is there a way to do this without installing the Quest Modules?
0
Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

 
Joseph MoodyBlogger and wearer of all hats.Commented:
Yes - if you have a 2008 R2 web services, you can use the AD builtin powershell cmdlets.

Just replace qad- with ad-

The Quest Modules are very nice though and super simple! You just need them on a workstation.
0
 
infradatelAuthor Commented:
Ok thanks will go e it a try now I have a server with web services on
0
 
McKnifeCommented:
Hi.

Have a look at the concept of shadow groups. http://www.youtube.com/watch?v=HMixa01i78g In the descriptive text, a script is linked.
0
 
infradatelAuthor Commented:
With the help of both of you I have managed to get this working as required, using shadow groups I have even managed to get it to automate deletion of computers removed from the OU. THanks Guys.
0
 
Joseph MoodyBlogger and wearer of all hats.Commented:
Awesome!

If you can, post your script. Others may find it useful!
0
 
McKnifeCommented:
Could you do all you wanted using shadow groups?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now