Need help to create batch file to run gam tool

57 views
Skip to first unread message

Rajagopal Suresh

unread,
Jul 22, 2021, 7:00:08 AM7/22/21
to GAM for Google Workspace
Hi,

Please guide me to create batch file to run the gam command to transfer the drive data for 20 accounts using batch files with below syntax.

Syntax: 
gam user a...@email.com transfer drive email-...@email.com

Brian Kim

unread,
Jul 24, 2021, 10:15:27 AM7/24/21
to GAM for Google Workspace
Just put them in one line after the other, save it as txt file.

then do

gam batch filename.txt

Rajagopal Suresh

unread,
Jul 26, 2021, 2:07:53 AM7/26/21
to GAM for Google Workspace
Hi

Thanks for your suggestion. I need one more help.

I have created a batch file to archive emails with the below syntax but found it is creating a new label instead of taking the existing label which is already available. could you please help me take the existing label for the below syntax.

gam user a...@test.com modify messages query "to:b...@test.com in:inbox" addlabel "b1" removelabel "INBOX" maxtomodify 9000000 doit

I have created already a label name with  b1 under BD (parent label) in a1 email account so please guide me on how can I mention in the command to take sublabels like BD\b1.

The above syntax is creating a new label for archiving emails but not taking the existing label b1 which is under BD parent group.
Please help me to suggest commands for my issue. 

Ross Scroggs

unread,
Jul 26, 2021, 9:32:08 AM7/26/21
to google-ap...@googlegroups.com
If you want the label b1 under BD thien you have to indicate that.

gam user a...@test.com modify messages query "to:b1@test.com in:inbox" addlabel "BD/b1" removelabel "INBOX" maxtomodify 9000000 doit

Ross

On Jul 25, 2021, at 11:07 PM, Rajagopal Suresh <sures...@gmail.com> wrote:

Hi

Thanks for your suggestion. I need one more help.

I have created a batch file to archive emails with the below syntax but found it is creating a new label instead of taking the existing label which is already available. could you please help me take the existing label for the below syntax.

gam user a...@test.com modify messages query "to:b1@test.com in:inbox" addlabel "b1" removelabel "INBOX" maxtomodify 9000000 doit

I have created already a label name with  b1 under BD (parent label) in a1 email account so please guide me on how can I mention in the command to take sublabels like BD\b1.

The above syntax is creating a new label for archiving emails but not taking the existing label b1 which is under BD parent group.
Please help me to suggest commands for my issue. 
 

On Saturday, July 24, 2021 at 7:45:27 PM UTC+5:30 the.br...@gmail.com wrote:
Just put them in one line after the other, save it as txt file.

then do

gam batch filename.txt



On Thursday, July 22, 2021 at 4:00:08 a.m. UTC-7 sures...@gmail.com wrote:
Hi,

Please guide me to create batch file to run the gam command to transfer the drive data for 20 accounts using batch files with below syntax.

Syntax: 
gam user a...@email.com transfer drive email-...@email.com

-- 
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/a8955d65-bc9e-4a2e-b21f-6ba0634b76acn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages