Assign all users in an OU to a group

7,411 views
Skip to first unread message

Paul Wood

unread,
Mar 8, 2011, 4:14:24 PM3/8/11
to Google Apps Manager
Is there a way to assign all users in an OU to a google group? I
thought this would be easy. The only way I can see to do it, is get
the list of users email address from the OU using gam, then use that
to assign them to a group.

Is that correct?

Oliver Hartley

unread,
Mar 8, 2011, 5:00:37 PM3/8/11
to google-ap...@googlegroups.com, Paul Wood
yep that is correct.... it should be tow accions with gam, get the user from OU the update user into a group....




--
You received this message because you are subscribed to the "Google Apps Manager" group.
To post to this group, send email to
google-ap...@googlegroups.com
To unsubscribe from this group, send email to
google-apps-man...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/google-apps-manager

Paul Wood

unread,
Mar 8, 2011, 5:12:01 PM3/8/11
to Oliver Hartley, google-ap...@googlegroups.com
Is there a way I could bash script this?  All my users are sorted into correct OUs and I would like to use that ability to manage my users.

We have a couple of people that manage users and they manage to put the into the correct OU's but forget to update their group status.  I would like to be able to loop through once a month and update a users group based on their OU.

Thanks,
Paul Wood
P. 802-382-1720
pw...@addisoncentralsu.org
Systems Administrator, ACSU

Please consider the environment before printing this email. 
WARNING: This message may contain information that is confidential and/or protected under the Family Education Rights and Privacy Act or other lawfully recognized privilege. If you receive this message in error or through inappropriate means, please reply to this message to notify the Sender that the message was received by you in error, and then permanently delete this message from all storage media, without forwarding or retaining a copy.

Sandip Shah

unread,
Mar 8, 2011, 5:25:25 PM3/8/11
to Google Apps Manager
If you are on EDU or Premier editions, then just setup GADS (Google
Apps Directory Sync). It's free. Run it whenever you want (or set it
on a schedule).

Ss
> > Gerente de Tecnología* I* CTO *I*
> > Soluciones Orión <http://www.solucionesorion.com/> *I* Argentina - Chile -
> > Colombia - Perú <http://www.solucionesorion.com/contactenos>
>
> >http://www.youtube.com/watch?v=9liUx_8WWJM&feature=PlayList&p=1929B59...

Melissa Benson

unread,
Mar 9, 2011, 8:39:12 AM3/9/11
to Google Apps Manager
Yeah, we use GADs and it works perfectly if you want to automatically
put an OU into an gapp org. You could even do it once to get the bulk
of your users and then stop using it.

Paul Wood

unread,
Mar 9, 2011, 9:03:48 AM3/9/11
to google-ap...@googlegroups.com, Sandip Shah
When I say OU, I'm talking about Google's OU, not AD.

Thanks for the quick feedback, It's reaffirms what needs to be done.

Regards,
Paul Wood
P. 802-382-1720
pw...@addisoncentralsu.org
Systems Administrator, ACSU

Please consider the environment before printing this email. 
WARNING: This message may contain information that is confidential and/or protected under the Family Education Rights and Privacy Act or other lawfully recognized privilege. If you receive this message in error or through inappropriate means, please reply to this message to notify the Sender that the message was received by you in error, and then permanently delete this message from all storage media, without forwarding or retaining a copy.



Moti Levy

unread,
Mar 9, 2011, 10:02:41 AM3/9/11
to google-ap...@googlegroups.com, Paul Wood, Sandip Shah
If all you are trying to do is update group membership based on OU you can do it with a simple bash loop.
let say you want all users in OU - students to be in group students you can do :

for u in `gam print users ou | grep students | awk -F, '{print $2}'` ; do
 gam update group student add member $u
done

of course it would need some tweaking but the idea is the same.


Reply all
Reply to author
Forward
0 new messages