URL Blocking GAM Commands

160 views
Skip to first unread message

Gunderson, Greg

unread,
Sep 21, 2022, 1:59:56 PM9/21/22
to google-ap...@googlegroups.com
We created an OU at each grade-level that we move students into when they abuse their browsing privileges.  In the restricted OUs, we have "*" for "Blocked URLs" and maintain a custom list under each grade-level OU for sites that they need for schoolwork.  Rather than having to maintain so many separate lists, is there a way I could use GAM to update the "Blocked URL Exceptions List" on a specific set of OUs in our domain?  What would be really cool is for GAM to look at a Google Sheet and sync that with the "Block List Exceptions" lists at each OU level.  We do have Securly but they are removing the ability to have multiple policies in their free version.

Thanks in advance for any help!
Greg

--

facebook
twitter

Gregory Gunderson

Director of Technology

Denison Community School District

7122654210
ggund...@denisoncsd.org
www.denison.k12.ia.us
819 N. 16th Street








CONFIDENTIALITY NOTICE:
  This email message, including any attachments, 
is for the sole use of the intended recipient(s) and may contain confidential and privileged information.  Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Furthermore, the e-mail system, equipment, network, back up files and records are property of the Denison Community School District.

Menachem Tauber

unread,
Feb 23, 2023, 12:50:40 PM2/23/23
to GAM for Google Workspace
Following up on this, wondering as well if there is a way to ADD a URL to the Blocked URL exceptions using a csv with ou and URL

Kim Nilsson

unread,
Feb 26, 2023, 3:53:35 AM2/26/23
to GAM for Google Workspace
Well, yes, but you need to print the policies once to see the structure.

Here's a command to print all your current local (not-inherited) rules.

$ cat bin/print_all_local_not_inherited_Chrome_policies_todrive
gam print ous | gam config num_threads 5 csv_output_row_drop_filter ^direct$:regex:FALSE redirect csv - multiprocess todrive csv - gam print chromepolicies ou ~orgUnitPath

Here's the result for URLBlocking.

name,orgUnitPath,parentOrgUnitPath,direct,additionalTargetKeys,fields,fields.0.name,fields.0.value,fields.0.value.bookmarks,fields.0.value.bookmarks.0.link.name,fields.0.value.bookmarks.0.link.url,fields.0.value.bookmarks.1.link.name,fields.0.value.bookmarks.1.link.url,fields.0.value.duration,fields.0.value.toplevelName,fields.0.value.value,fields.1.name,fields.1.value
chrome.users.UrlBlocking,/Demo/EDU/Skogsskolan 1-6/1A,/Demo/EDU/Skogsskolan 1-6/1A,TRUE,0,2,urlBlocklist,aftonbladet.se,,,,,,,,,urlAllowlist,google.com

Then edit the data of the relevant setting, and use that as input for an update command.

Here's an example I used to set the wallpaper for users and devices.


Kim Nilsson

unread,
Feb 26, 2023, 4:00:50 AM2/26/23
to GAM for Google Workspace
If you want to know that exact setting for only one OU you can use a direct command.

gam config num_threads 5 csv_output_row_filter name:regex:chrome.users.UrlBlocking csv_output_row_drop_filter ^direct$:regex:FALSE redirect csv - multiprocess todrive print chromepolicies ou "/Demo/EDU/Some School/1A" namespace chrome.users

Reply all
Reply to author
Forward
0 new messages