GAM-team / GAM

command line management for Google Workspace
https://github.com/GAM-team/GAM/wiki
Apache License 2.0
3.54k stars 473 forks source link

Blank Fields in CSV file dump chrome devices to the base OU #1692

Closed undeadrattler closed 1 month ago

undeadrattler commented 3 months ago

The issue tracker is for reporting product deficiencies. "How do I?" questions should be posted to the discussion forum at https://groups.google.com/group/google-apps-manager. When in doubt, start at the discussion forum and return here only when instructed to do so.

Please confirm the following:

Full steps to reproduce the issue:

  1. Create a CSV file with asset and ou columns.
  2. Place a blank entry into either column.
  3. Run gam csv test.csv gam update cros "query:asset_id:'~~asset~~'" ou '~~ou~~'

Expected outcome (what are you trying to do?): Gam will update things that have information in the fields, and error out/not find a device or OU on things that don't.

Actual outcome (what errors or bad behavior do you see instead?): Gam will take the specified device and dump it in the base OU, and dump all devices in the base OU.

some small troubleshooting shows that gam print cros query "asset_id:''" will select every device in the organization, and gam info org '' will select the base OU.

gam print cros query "asset_id:' '" will also select every device, but gam info org ' ' will return with OU not found.

I understand that a blank is specified by using the single quotes, but why does a blank input return everything or default to the base OU instead of erroring out?

taers232c commented 3 months ago

This can be handled with Advanced GAM, send me a Meet/Zoom invitation.

Ross

Ross Scroggs @.***

On Jul 25, 2024, at 6:53 AM, Calvin Kruse @.***> wrote:

The issue tracker is for reporting product deficiencies. "How do I?" questions should be posted to the discussion forum at https://groups.google.com/group/google-apps-manager. When in doubt, start at the discussion forum and return here only when instructed to do so.

Please confirm the following:

I have upgraded to the latest GAM release from https://github.com/GAM-team/GAM/releases and I still have this issue. I am typing the command as described in the GAM Wiki at https://github.com/jay0lee/gam/wiki Full steps to reproduce the issue:

Create a CSV file with asset and ou columns. Place a blank entry into either column. Run gam csv test.csv gam update cros "query:asset_id:'asset'" ou 'ou' Expected outcome (what are you trying to do?): Gam will update things that have information in the fields, and error out/not find a device or OU on things that don't.

Actual outcome (what errors or bad behavior do you see instead?): Gam will take the specified device and dump it in the base OU, and dump all devices in the base OU.

some small troubleshooting shows that gam print cros query "asset_id:''" will select every device in the organization, and gam info org '' will select the base OU.

gam print cros query "asset_id:' '" will also select every device, but gam info org ' ' will return with OU not found.

I understand that a blank is specified by using the single quotes, but why does a blank input return everything or default to the base OU instead of erroring out?

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/GAM/issues/1692, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYLZ2QE5JHCZ6JTYVT73ZOD7OHAVCNFSM6AAAAABLOTRC5GVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQZTAMBTGUYDMOA. You are receiving this because you are subscribed to this thread.

undeadrattler commented 3 months ago

I think you may have misunderstood - I have used this successfully in the past with a CSV that did not have blank lines. I updated a sheet I use and had a couple devices that I missed putting the OU in and a couple devices that I hadn't assigned asset tags to yet.

The expected result would be that those get skipped instead of moving every device in my organization to the base OU.

Unless Advanced Gam has an undo button somewhere, I've got a bit of manual cleanup to do. I wanted to forewarn others and see if that's intended behavior, not look for advice :)

undeadrattler commented 3 months ago

ah, I misunderstood slightly - I didn't realize Advanced GAM was the name of a separate project. Still, this feels like an unintended result with Standard GAM and I feel it deserves some attention.

taers232c commented 3 months ago

Send me a Meet/Zoom invitation

Ross

Ross Scroggs @.***

On Jul 25, 2024, at 8:27 AM, Calvin Kruse @.***> wrote:

ah, I misunderstood slightly - I didn't realize Advanced GAM was the name of a separate project. Still, this feels like an unintended result with Standard GAM and I feel it deserves some attention.

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/GAM/issues/1692#issuecomment-2250678808, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL52KSDHU7IUH37FHN3ZOEKN5AVCNFSM6AAAAABLOTRC5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJQGY3TQOBQHA. You are receiving this because you commented.

jay0lee commented 1 month ago

closing this but if there are still issues feel free to discuss on the GAM group or chat.