Students not in a Google Classroom

49 views
Skip to first unread message

J Cracknell

unread,
Jul 25, 2022, 9:07:05 AM7/25/22
to GAM for Google Workspace
Hi

How can I create to csv a list of all accounts not in a Google Classroom (from an OU)

J Cracknell

unread,
Jul 25, 2022, 9:07:33 AM7/25/22
to GAM for Google Workspace
I should add using XTD3

Ross Scroggs

unread,
Jul 25, 2022, 12:12:09 PM7/25/22
to google-ap...@googlegroups.com
Interesting question, the solution is not obvious to me at the moment.

Send  me a Meet/Zoom invitation and we'll explore.

Ross

On Mon, Jul 25, 2022 at 6:07 AM J Cracknell <jcrac...@sancroft.stbenets.org> wrote:
Hi

How can I create to csv a list of all accounts not in a Google Classroom (from an OU)


Harleston Primary Academy and Archbishop Sancroft High School are merging to become The Harleston Sancroft Academy. In preparation for this, my email address has changed.

Please update your address book for users to their na...@sancroft.stbenets.org address.
The school office addresses are pri...@sancroft.stbenets.org (Phone: 01379 853211) and seco...@sancroft.stbenets.org (Phone: 01379 852561).
Our Twitter handle is now @SancroftAcademy



The information contained within this e-mail / attachments is confidential. If you are not the intended recipient, please delete the message and attachments immediately and notify the sender. Any unauthorised dissemination or copying of this e-mail, or any misuse or wrongful disclosure of the information contained in it is strictly prohibited and may be illegal. The opinions, statements and thoughts expressed in this e-mail and its attachments if any are those of the individual sender and not necessarily of the Academy or any associated party. Contracts can not be entered into without an official purchase order.

St Benet’s Multi-Academy Trust (Company No. 11276420) registered in England and Wales. Office: Orchard House, Hall Lane, East Tuddenham, Norfolk, NR20 3LR. Tel: 01603 880853 https://stbenets.org

--
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/33ac9e61-1c76-4d19-8365-6a45dd9df7c6n%40googlegroups.com.


--

NEWMAN, P

unread,
Jul 25, 2022, 5:55:00 PM7/25/22
to google-ap...@googlegroups.com
HI,
I don't have a perfect solution. However if you are using Linux rather than sending todrive use &> studentcourse.csv which redirects the stdout and stderr to the file studentcourse.csv
for example

gam ou <OU_Path>  print users primaryemail | gam redirect csv ./Students1.csv multiprocess csv - gam print courses student ~primaryEmail  &> studentcourse.txt

This generates a file that has the form 
"Getting all Courses that match query (Student: stu...@domain.com), may take some time on a large Google Workspace Account....
Got 32 Courses..."
For each student in the ou.
The line we are interested in is  'Got 0 Courses'  which is of course what a student with no classes will return. The line before that contains the email address of the classless student.
Then if you grep that file with a command something like this

grep -B 1 'Got 0 Courses' studentcourse.txt | grep -oP '(?<=Student:).*?(?=\))' >  > studentnoclassrooms.txt

That will return all 'Got 0 Courses' occournances and the line before. That is then piped into a further grep to return the text in between 'Student:' and ')' which will just leave the students email address.
I can't think of another way to do this, but I think this is workable, not sure how you could do this with the windows version of GAM.
any way an interesting problem hope this helps
Piers





--

Piers Newman

Network Technician

 

Ross Scroggs

unread,
Jul 25, 2022, 6:12:49 PM7/25/22
to google-ap...@googlegroups.com
Piers,

Very clever, verify that the following gives you the same studentcourse.txt; it uses redirect stderr to get the Getting/Got messages.
gam ou <OU_Path>  print users primaryemail | gam redirect csv ./Students1.csv multiprocess redirect stderr ./studentcourse.txt multiprocess csv - gam print courses student ~primaryEmail

Ross



--

NEWMAN, P

unread,
Jul 28, 2022, 3:22:11 AM7/28/22
to google-ap...@googlegroups.com
Thanks Ross,
That command does give the same list. 
This will be useful for me at the beginning of term as we use a third party app to populate our classrooms. If the students email is incorrect in our MIS system they won't have any classes which then can go unnoticed.  So thanks to the OP for asking the question!
Piers

Reply all
Reply to author
Forward
0 new messages