Best AI tool for helping with GAM commands?

87 views
Skip to first unread message

Jason Olson

unread,
Jul 4, 2026, 9:59:40 PMJul 4
to GAM for Google Workspace
I have spent the last couple months trying to use Gemini to help me with GAM commands but it gets it wrong far too often.

Anyone have experience with Claude, ChatGPT, or others? What's the best?

Thanks in advance.

Jason Olson

Steven Haymes

unread,
Jul 4, 2026, 10:22:10 PMJul 4
to google-ap...@googlegroups.com, Jason Olson

While I have not used Gemini for GAM, I have used it for several other IT issues and I have seen the error easily rate go over 60% where it goes down a rabbit hole trying to correct one if its' mistake after another. If you tell Gemini that it gave the wrong answer, then sometimes that will help and it will back out of the rabbit hole. Otherwise, it will keep digging. I have gotten some good results on IT issues though so Gemini can be useful.

Steve

--
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 visit https://groups.google.com/d/msgid/google-apps-manager/f478fb35-a553-4a5e-a86f-a85010785f4fn%40googlegroups.com.

Marshall Giguere

unread,
Jul 4, 2026, 11:21:42 PMJul 4
to google-ap...@googlegroups.com
Jason;

I have not found any models that I have tested that deal with the subtleties of GAM syntax for anything beyond the simple to date.  As with all LLM's (next word prediction models) they are trained on the good and the garbage.  I just did a test running on the latest gemma4:12b model asking it to produce a very simple GAM command to find info for a user by last name.  The answer  "gam print users ~"Smith".  This is of course garbage.  When pushed the model said I needed to use: --query "name:Smith", close but no cigar.
The correct approach would be:
> gam print users query "familyname:'Smith'" | gam csv - gam info user ~primaryEmail.

Keeping in mind that I am using the most recent release of Google's Gemma4 model the result was not encouraging.  My advice is that if you are not a subject matter expert, or very  knowledgeable, you are likely to be disappointed.  Your mileage may vary.



--

Shaun Goodwin

unread,
Jul 5, 2026, 7:45:13 PM (13 days ago) Jul 5
to google-ap...@googlegroups.com

One thing we have found successful when using LLMs when building complex gam commands queries and scripts is to ensure there is a GEM for Gemini or Projects and Skills in Claude and explicitly stating that all commands must be verified against the official wiki.

 

Something like:

Role and Primary Objective

You are an expert Collaboration Engineer and Google Workspace administrator specializing in bulk directory operations using GAM 7 and PowerShell 7. Your primary objective is to generate, review, and optimize enterprise-grade, non-interactive automation scripts.

Source of Truth (Critical Constraint)

  • GAM 7 Strict Validation: You must validate every GAM command against the official GAM 7 GitHub repository (https://github.com/GAM-team/GAM) before providing it.
  • No Legacy Syntax: Never use, suggest, or mix syntax from GAM or GAMADV-XTD3.

Performance and Architecture

  • Batch Processing: Prioritize performance-optimized, non-interactive batch processing for bulk directory objects. Scripts must be designed to run unattended.
  • Native Filtering: Push as much data filtering as possible to the GAM execution level. Actively leverage arguments like csv_output_row_filter to minimize the dataset size before it reaches PowerShell.
  • PowerShell 7 Optimization: When writing PowerShell wrappers for GAM, utilize thread-safe collections and parallel execution logic (e.g., ForEach-Object -Parallel) to handle large-scale operations efficiently.

Output Format

  • Lead with the script. Provide clean, heavily commented code blocks.
  • Detail any complex parallelization or filtering logic briefly after the script.
  • Never hallucinate flags. If a requested operation is not natively supported by the official GAM 7 wiki, state that clearly and provide the most efficient workaround.

 

 

Regards,

 

Shaun Goodwin

IMPORTANT - This email and any attachments may be confidential. If received in error, please contact us and delete all copies. Before opening or using attachments check them for viruses and defects. Regardless of any loss, damage or consequence, whether caused by the negligence of the sender or not, resulting directly or indirectly from the use of any attached files our liability is limited to resupplying any affected attachments. Any representations or opinions expressed are those of the individual sender, and not necessarily those of the Department of Education.

Jason Olson

unread,
Jul 5, 2026, 7:48:19 PM (13 days ago) Jul 5
to GAM for Google Workspace
Thank you all.

Yes, Shaun, this is what I've been attempting as well. I uploaded GamCommands.txt (I understand this to be a fairly comprehensive set of commands, syntaxes, and definitions) to a Gem's knowledge base and instructed the Gem to strictly use that. It still fails miserably, often. I wonder if Claude would do better.

Jason

Ross Scroggs

unread,
Jul 5, 2026, 8:45:37 PM (13 days ago) Jul 5
to google-ap...@googlegroups.com
Can't you point GEM to the wiki?

Ross
----
Ross Scroggs



Hervé Godart

unread,
Jul 6, 2026, 5:51:22 AM (13 days ago) Jul 6
to GAM for Google Workspace
Hello.
With Claude Code, I use the GAM-Workspace MCP; if that doesn't work, It use GAM commands directly.
I am very satisfied with it.
regards

Shaun Goodwin

unread,
Jul 7, 2026, 12:46:15 AM (12 days ago) Jul 7
to google-ap...@googlegroups.com

I have just started exploring using Google Antigravity using numerous models explicitly calling out the wiki etc as per previous message and had some great results finding solutions to problems with a level of complexity I’ve been unable to solve independently.

 

Regards,

 

Shaun Goodwin

--

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.

Reply all
Reply to author
Forward
0 new messages