Disabling the Google Chat Service for Some Students

The administration of a high school wants to disable the Google Chat service for some students.

A simple way to accomplish this would be to create a group named “no-chat” and set the Google Chat service to OFF for that group. However, in Google Workspace, services can only be set to ON for a group. It would be ideal if OFF could also be set, but that’s not currently possible.

Another option would be to create a new Organizational Unit (OU), set the service to OFF for that OU, and move the necessary users to it. While this approach works, it complicates the OU structure, which could become increasingly complex when future changes are required.

So, what is the best solution?

Set the Google Chat service to OFF for the “/student/HS” OU. Then, create a group named “HS-google-chat,” add all active high school users as members, and set the Google Chat service to ON for that group. Finally, remove the students for whom Google Chat should be disabled from the group.

This solution seems promising, but what happens when new students enroll in the high school or former students re-enroll? How can the “HS-google-chat” group remain up-to-date with all the students who should have Google Chat enabled?

The answer is to use GAM!

What I came up with is a 3-step process. The first step exports all the active users from the high school OU. The second step creates a new .csv file that removes any students that are listed in a nochat.csv file. The final step synchronizes the HS-google-chat group from the revised .csv file.

All of these steps are added to a Bash script and run as a cron job. Here is an example of the Bash script:

#! /bin/bash
export PATH=$PATH:/home/user/bin/gam7
export GAMCFGDIR="/home/user/GAMConfig"
# This exports all active users from the HS OU to a csv named HS_users.csv
gam redirect csv /home/user/GAMWork/HS_Chat/HS_users.csv print users query "orgUnitPath='/student/HS' isSuspended=false"

# This creates a new csv file named HS_chat_users.csv that is all the HS_users
# except users who are in the nochat.csv file
awk 'FNR==NR {a[$0];next} !($0 in a)' /home/user/GAMWork/HS_Chat/nochat.csv /home/user/GAMWork/HS_Chat/HS_users.csv > /home/user/GAMWork/HS_Chat/HS_chat_users.csv

# This syncs the HS_google_chat group with the users in the HS_chat_users.csv
# file
gam update group HS-google-chat sync members csvfile /home/user/GAMWork/HS_Chat/HS_chat_users.csv:primaryEmail

Currently, changing the users who should have Google Chat disabled requires manually editing the nochat.csv file. What I’d like to have it do is pull the list of students from a Google Sheet that is edited by the high school administration. That would give them control over which students don’t get Google Chat.

EV Charging Noob

I made my first attempt to charge my EV at an Electrify America charging station. I tried to use the “second” plug on a unit, but another patron let me know that won’t work. Silly me, I thought two plugs on a unit meant two chargers. There’s two to accommodate either side of a car’s charging port location (the cords are short). There were no open chargers available and two other people waiting, so I left. I’m sure I provided a chuckle to everyone watching. Oh, well.

Adding Both Channels from a Dahua IPC Camera into VI MonitorPlus

In order to get both channels from a Dahua IPC-HDBW4231F-E2-M camera into VI MonitorPlus, select ONVIF as the manufacturer and ONVIF Profile S Compliant Camera as the model. Select the Shared IP Address checkbox and use Camera # 1 for channel 1 and Camera # 3 for channel 2 (camera numbers 2 and 4 are for the secondary streams). Each channel needs to be added as a seperate camera.

Style Guide

Here is a style guide for kevrodg.net. This is a regular paragraph. The Markdown syntax will make it easier to write blog posts.

Header 2

This is a paragraph below a level 2 header. Is there enough information here to make a qualitative judgement about this section? Here’s a little bit more text. I could type more here, but I think it’s enough.

Code Needed

I might write a post that has some code in it. That would look like this:

Typing ifconfig | grep netmask in the CLI will show the IP addresses on a Mac.

Code blocks will look like this:

def reverse(text):
    pos = -1
    rev = ""
    for i in text:
        rev = rev + text[len(text) + pos]
        pos = pos -1
print rev

reverse("Python!")

Blockquotes

Here is how blockquotes will look:

This is part of the blockquote. This is another part of the blockquote. How is Micro.blog handling all this?

This is a regular paragraph after a block quote. Nice, right?