change all users in an ou from suspended to active

171 views
Skip to first unread message

dbmct

unread,
Apr 2, 2020, 10:47:43 AM4/2/20
to GAM for G Suite
having a pretty hard time with this. Trying:

$Users = gam print users limittoou "/Student/Elem/2031-1"
foreach($User in $Users) {
gam update user $User suspended 0
}

Any ideas?

Jay Lee

unread,
Apr 2, 2020, 10:55:39 AM4/2/20
to google-ap...@googlegroups.com

gam print users query orgUnitPath=/Student/Elem/2031-1 | gam csv - gam update user ~primaryEmail suspended false

Jay Lee


--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" 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/20e8dac9-6a10-4ca6-810c-ed11120ea0e5%40googlegroups.com.

Ross Scroggs

unread,
Apr 2, 2020, 10:56:11 AM4/2/20
to google-ap...@googlegroups.com
dbmct,

gam ou "/Student/Elem/2031-1" update user suspended 0

dbmct

unread,
Apr 2, 2020, 10:59:21 AM4/2/20
to GAM for G Suite
Just figured it out with this:

$Users = gam print users query "orgunitPath=/Student/Elem/2031-1" | Select -Skip 1
foreach($User in $Users) {
gam update user $User suspended 0
}

Looks like Jay and Ross had some better code anyhow!

Thanks guys!
Reply all
Reply to author
Forward
0 new messages