Bulk remove alternative email from ou

73 views
Skip to first unread message

J Cracknell

unread,
Sep 26, 2024, 10:04:43 AM9/26/24
to GAM for Google Workspace
Hi

Students in an ou might have an alternative email domain ie @harleston.stbenets.org

How do I bulk remove these alternative emails  

✉ Kevin Melillo

unread,
Sep 26, 2024, 10:11:10 AM9/26/24
to google-ap...@googlegroups.com
Good morning,
Have you determined if this was set up as an alias domain or a secondary domain?

If it's a secondary domain, then you can remove the alias from the student account with the following command:

gam delete alias <full email alias>

if you would like to use gam to script this, create a csv (named aliaslist.csv) with the header emailAlias, and every other line being an alias, then use the following GAM command

gam csv aliaslist.csv gam delete alias ~emailAlias

This will run through the entire list, and remove each alias.

Please post your results, or any issues you experience here.

Good luck.


Harleston Sancroft Academy
Primary: School Lane, Harleston, Norfolk IP20 9HG  01379 853211
Secondary: Wilderness Lane, Harleston, Norfolk IP20 9DD  01379 852561


The information contained within this e-mail and any 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 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. Contact details 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/a6d9ea4c-87cf-43ed-a1a4-afdfd298ef4an%40googlegroups.com.

J Cracknell

unread,
Sep 26, 2024, 11:03:39 AM9/26/24
to GAM for Google Workspace
Hi

It's a secondary domain (additional email) as those students moved schools within our group.

Thank you for the details.

Ross Scroggs

unread,
Sep 26, 2024, 11:18:25 AM9/26/24
to google-ap...@googlegroups.com
gam redirect csv ./OldStudentAliases.csv print aliases limittoou /Students aliasmatchpattern "^.+@harleston.stbenets.org$"
gam redirect stdout ./DeleteOldStudentAliases.txt multiprocess redirect stderr stdout csv OldStudentAliases.csv gam remove alias "~Target" user "~Alias"

Ross
----
Ross Scroggs



Reply all
Reply to author
Forward
0 new messages