taers232c / GAMADV-XTD3

Command line tool to manage Google Workspace
732 stars 86 forks source link

Question: GAM Redirect #222

Closed wallarug closed 2 years ago

wallarug commented 2 years ago

Hey,

I just need some assistance with GAM redirect. I want a nicely formatted CSV file for the data I'm exporting from Google Groups. When I redirect it with a > it all comes out formatted poorly (just raw text, headers everywhere).

I tried gam redirect as below.

gam redirect csv output.csv multiprocess csv input.csv gam print group-members group ~email roles owners,managers

However, this results in no output.csv file being created. It just doesn't create anything.

The gam print command runs without errors.

Any assistance on this would be great.

taers232c commented 2 years ago

Do: gam config verify What is the value of drive_dir? output.csv should be in that folder; if you want output.csv to be in the current folder do:

gam redirect csv ./output.csv multiprocess csv input.csv gam print group-members group ~email roles owners,managers Ross

@.***

On Dec 1, 2021, at 3:14 PM, wallarug @.***> wrote:

Hey,

I just need some assistance with GAM redirect. I want a nicely formatted CSV file for the data I'm exporting from Google Groups. When I redirect it with a > it all comes out formatted poorly (just raw text, headers everywhere).

I tried gam redirect as below.

gam redirect csv output.csv multiprocess csv input.csv gam print group-members group ~email roles owners,managers However, this results in no output.csv file being created. It just doesn't create anything.

The gam print command runs without errors.

Any assistance on this would be great.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/222, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYLYSQ572MZC3JD7ZZKDUO2T4LANCNFSM5JFWPKIQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

wallarug commented 2 years ago

You are right. Thanks again. Sorry for the disturbance.

wallarug commented 2 years ago

Hey Ross,

Sorry - one other question. I tried GAM redirect and it outputted a blank file for a different query. Any reason for this?

gam redirect csv $outputFile multiprocess csv $inputFile gam user "~owners.0.emailAddress" add drivefileacl "~id" user $($userEmail) role writer

It completes the query successfully.

taers232c commented 2 years ago

You want to redirect stdout not csv; redirect csv is for print commands.

@.***

On Dec 1, 2021, at 4:51 PM, wallarug @.***> wrote:

Hey Ross,

Sorry - one other question. I tried GAM redirect and it outputted a blank file for a different query. Any reason for this?

gam redirect csv $outputFile multiprocess csv $inputFile gam user "~owners.0.emailAddress" add drivefileacl "~id" user $($userEmail) role writer

It completes the query successfully.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/222#issuecomment-984192124, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL4O2YGNEF42TXZOVTLUO27KVANCNFSM5JFWPKIQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

wallarug commented 2 years ago

Will this produce a CSV with columns instead of just all the RAW text output?

taers232c commented 2 years ago

Just the text output.

$ gam user testsimple add drivefileacl 1uK-Ca4obeBiojvhWFfMH12lHz71GTwBmJGbL-KnY2tM user testuser2 role writer
User: testsimple@rdschool.org, Add 1 Drive File/Folder ACL
  User: testsimple@rdschool.org, Drive File/Folder ID: 1uK-Ca4obeBiojvhWFfMH12lHz71GTwBmJGbL-KnY2tM, Permission ID: testuser2@rdschool.org, Added
  Test User2
    id: 17868704419089105705
    type: user
    emailAddress: testuser2@rdschool.org
    domain: rdschool.org
    role: writer
    photoLink: https://lh3.googleusercontent.com/a-/AOh14Ghei9nYMssxKtOcRxDc5gbLIT8v2YQhllJMOWmu=s64
    deleted: False

Would CSV format be just for logging?

wallarug commented 2 years ago

Yep, for logging purposes.

So that if something goes astray, it is traceable and reversible.

taers232c commented 2 years ago

I'm working on it.

taers232c commented 2 years ago

See: https://github.com/taers232c/GAMADV-XTD3/wiki/GamUpdates

On Wed, Dec 1, 2021 at 10:45 PM wallarug @.***> wrote:

Yep, for logging purposes.

So that if something goes astray, it is traceable and reversible.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/222#issuecomment-984338820, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL7XZC4PUWCJIXSPOUTUO4IY3ANCNFSM5JFWPKIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Ross Scroggs @.***

wallarug commented 2 years ago

Legend! Can't wait 👍

wallarug commented 2 years ago

I understand you are still testing this new functionality.

I tested out GAM 6.10.03 but still had issues. I think I am using the wrong format / syntax of my GAM command.

gam redirect csv $outputFile multiprocess csv $inputFile gam user "~owners.0.emailAddress" add drivefileacl "~id" user $($userEmail) role writer

taers232c commented 2 years ago

Add csv at the end.

Send me a Meet/Zoom invitation.

gam redirect csv $outputFile multiprocess csv $inputFile gam user "~owners.0.emailAddress" add drivefileacl "~id" user $($userEmail) role writer csv

-- @.***

On Dec 2, 2021, at 3:05 PM, wallarug @.***> wrote:

I understand you are still testing this new functionality.

I tested out GAM 6.10.03 but still had issues. I think I am using the wrong format / syntax of my GAM command.

gam redirect csv $outputFile multiprocess csv $inputFile gam user "~owners.0.emailAddress" add drivefileacl "~id" user $($userEmail) role writer

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/222#issuecomment-985072900, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYLZAZQHCW5CTMFAOBNLUO73T3ANCNFSM5JFWPKIQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

taers232c commented 2 years ago

$ gam user testsimple create drivefileacls 123-Ca4obeBiojvhWFfMH12lHz71GTwBmJGbL-KnYxxx user testuser2 role writer User: @., Create 1 Drive File/Folder ACL User: @., Drive File/Folder ID: 123-Ca4obeBiojvhWFfMH12lHz71GTwBmJGbL-KnYxxx, Permission ID: @., Created Test User2 id: 17868704419089105705 type: user emailAddress: @. domain: domain.com role: writer photoLink: https://lh3.googleusercontent.com/a-/AOh14Ghei9nYMssxKtOcRxDc5gbLIT8v2YQhllJMOWmu=s64 deleted: False pendingOwner: False

$ gam user testsimple create drivefileacls 123-Ca4obeBiojvhWFfMH12lHz71GTwBmJGbL-KnYxxx user testuser2 role writer csv Owner,id,permission.deleted,permission.displayName,permission.domain,permission.emailAddress,permission.id,permission.pendingOwner,permission.photoLink,permission.role,permission.type @.,123-Ca4obeBiojvhWFfMH12lHz71GTwBmJGbL-KnYxxx,False,Test @.,17868704419089105705,False,https://lh3.googleusercontent.com/a-/AOh14Ghei9nYMssxKtOcRxDc5gbLIT8v2YQhllJMOWmu=s64,writer,user

-- @.***

On Dec 2, 2021, at 3:05 PM, wallarug @.***> wrote:

I understand you are still testing this new functionality.

I tested out GAM 6.10.03 but still had issues. I think I am using the wrong format / syntax of my GAM command.

gam redirect csv $outputFile multiprocess csv $inputFile gam user "~owners.0.emailAddress" add drivefileacl "~id" user $($userEmail) role writer

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/taers232c/GAMADV-XTD3/issues/222#issuecomment-985072900, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYLZAZQHCW5CTMFAOBNLUO73T3ANCNFSM5JFWPKIQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

wallarug commented 2 years ago

Hey, I will be free in about 15 minutes. I can email you the zoom link if you like? Appreciate your help.

wallarug commented 2 years ago

I'm getting "Does not exist" when I run only the update command. Regardless of csv flag or not, the update command is always failing now in 6.10.03. Add works perfectly fine (with and without csv).

gam user **@** update drivefileacl ********* **@** role owner
User: **@**, Update 1 Drive File/Folder ACL
  User: **@**, Drive File/Folder ID: **@**, Update Failed: Does not exist
gam user **@** update drivefileacl ********* **@** role editor
User: **@**, Update 1 Drive File/Folder ACL
  User: **@**, Drive File/Folder ID: **@**, Update Failed: Does not exist

Just as a separate thing too, is there any logic behind not having user before the user in the update? Add requires it but I've never had to do it with update.