Print users in an OU and sub OUs

45 views
Skip to first unread message

Xavier Rehder

unread,
Mar 29, 2023, 12:46:19 PM3/29/23
to GAM for Google Workspace
Is there a way to print all of the users in a OU and it's sub OU's? For example, I'm wanting all of the emails in a OU and the sub OU's so I can update all their profile photos at one time, instead of going OU to OU. I'm doing the following commands, but it only prints the users in the specific OU path and not the Sub OUs.

gam print users query "/OU/Path" > users.csv

gam csv "file path" gam update photo "path to image"

Ross Scroggs

unread,
Mar 29, 2023, 1:15:00 PM3/29/23
to google-ap...@googlegroups.com
Xavier,

This will include sub OUs.

gam print users query "orgUnitPath='/OU/Path'" > users.csv

gam csv users.csv gam update photo "path to image"


You could also do:

gam ou_and_children "/OU/Path" update photo "path to image"


Ross


--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/55ec030c-3f03-4bd6-a549-420e95a8ce99n%40googlegroups.com.


--

Xavier Rehder

unread,
Mar 29, 2023, 2:16:02 PM3/29/23
to GAM for Google Workspace
Thanks again, Ross! As always, you're super helpful! 
Reply all
Reply to author
Forward
0 new messages