Find all groups with a year at the end. (None of our regular groups end with a four digit number)
gam config csv_output_row_filter "email:regex:^.+[0-9]{
4}@domain.com$" redirect csv GroupsWithYear.csv todrive tdlocalcopy print groups
Find all groups without a year at the end.
gam config csv_output_row_drop_filter "email:regex:^.+[0-9]{
4}@domain.com$" redirect csv GroupsWithoutYear.csv todrive tdlocalcopy print groups
Find all groups for the year X. Here we did 2017. For testing purposes, we did "info group" instead of "delete group"
gam config csv_input_row_filter "email:regex:^.+
20...@domain.com$" redirect stdout deletegroups.log multiprocess redirect stderr stdout csv GroupsWithYear.csv gam info group ~email fields name quick
I am sure I can PowerSmell something to grab years to look at like addyear(-2) for a variable to be inserted into the script each year.