Jump to content
Forum²

Recommended Posts

Posted

Hi all,

 

New to this forum - love the layout!

 

I have a question - I'm setting up my first corporate domain and I'd like to add users to Groups via the OU they are in. I can't quite work out how to do this although I'm fairly sure it can be done.

 

I'm on (obviously) Server 2008 (FFL/DFL 2008).

 

Could anyone offer any quick pointers?

 

Many thanks!

  • 2 weeks later...
Posted

Using dsquery and dsmod may be the easiest way, if you are talking about doing this on a continuing basis and not just once.

 

A command like:

dsquery user "" | dsmod group "" -addmbr

 

For example:

dsquery user "ou=Sales,ou=West,dc=MyDomain,dc=com" will return a list of users in the West > Sales OU of mydomain.com

 

Then pipe that list into the dsmod command:

DSMOD group "CN=Testing,OU=testou,DC=MyDomain,DC=com" -addmbr which will add all the users returned in the first part to the Testing group in the testou OU.

 

 

If you want them to be added going forward, you'd have to put it in a script and schedule it to run every day or week or however often you want to keep them up to date.

 

If they had query-based security groups in Windows, it would be easier to do.

 

 

If you only need to do this once while you are setting up the domain, you can use the commands above, or you can just highlight everything in the OU and add them to the groups you want.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...