Giter VIP home page Giter VIP logo

gamadv-xtd3's Introduction

Introduction

GAMADV-XTD3 is a free, open source command line tool for Google Workspace (formerly G Suite) Administrators to manage domain and user settings quickly and easily.

GAMADV-XTD3 is built with Python 3.

This page provides simple instructions for downloading, installing and starting to use GAMADV-XTD3.

GAMADV-XTD3 runs on all versions of Google Workspace; Google Apps Free Edition has limited API support and not all GAM commands work.

GAMADV-XTD3 is a rewrite/extension of Jay Lee's GAM, without his efforts, this version wouldn't exist.

GAMADV-XTD3 is backwards compatible with GAM, meaning that if your command works with regular GAM, it will also work with GAMADV-XTD3. There may be differences in output, but the syntax is compatible.

Documentation

Documentation for GAMADV-XTD3 is hosted in the GitHub GAMADV-XTD3 Wiki and in Gam*.txt files.

Mailing List / Discussion group

The GAM mailing list / discussion group is hosted on Google Groups. You can join the list and interact via email, or just post from the web itself.

Source Repository

The official GAMADV-XTD3 source repository is on GitHub in the master branch.

Author

GAMADV-XTD3 is maintained by Ross Scroggs.

Requirements

To run all commands properly, GAMADV-XTD3 requires three things:

  • An API project which identifies your install of GAMADV-XTD3 to Google and keeps track of API quotas.
  • Authorization to act as your G Suite Administrator in order to perform management functions like add users, modify group settings and membership and pull domain reports.
  • A special service account that is authorized to act on behalf of your users in order to modify user-specific settings and data such as Drive files, Calendars and Gmail messages and settings like signatures.

Installation - First time GAM installation

Use these steps if you have never used any version of GAM in your domain. They will create a GAM project and all necessary authentications.

Downloads Configuration Install

Installation - Update Advanced GAM

Use these steps to update your version of GAMADV-XTD3.

Downloads Configuration UpdateAdvanced

Installation - Upgrading from Standard GAM

Use these steps if you have used any version of Standard GAM in your domain. They will update your GAM project and all necessary authentications.

Downloads Configuration UpgradeFromStandard

Installation - Upgrading from a prior version of GAMADV-X or GAMADV-XTD

Use these steps if you already use GAMADV-X or GAMADV-XTD. The updates may tell you to update your GAM project or authentications because new features have been included.

Updates Downloads UpgradeFromAdvanced

Multiple Versions

You can install multiple versions of GAM and GAMADV-XTD3 in different parallel directories.

gamadv-xtd3's People

Contributors

biosplus avatar extua avatar fbousquethopper avatar jay-eleven avatar joeromeo avatar larsen161 avatar matlanz avatar sreyemnayr avatar taers232c avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gamadv-xtd3's Issues

csvkmd error

When trying to sync guardians, I recieve the following error;

"Traceback (most recent call last):
File "gam.py", line 41763, in ProcessGAMCommand
File "gam.py", line 4747, in getEntityToModify
File "gam.py", line 4573, in getEntitiesFromCSVbyField
File "gam.py", line 2324, in openCSVFileReader
File "csv.py", line 98, in fieldnames
_csv.Error: line contains NULL byte"

This was running fine back in May, when I ran some test scripts. I have even tried using the same CSV I used back in May, but get the same result.

Query properties leads to KeyError-Exception

I tried to query the following, which perfectly works in API-Explorer, but leads to a KeyError-Exception in GAMADV-XTD3:

./gam user [email protected] show filelist fields id,properties query "properties has { key='CloudMigrator-Version' and value='3.15.5.0' }"
Getting all Drive Files/Folders that match query ('me' in owners and properties has { key='CloudMigrator-Version' and value='3.15.5.0' }) for [email protected]
Traceback (most recent call last):
  File "gam.py", line 41948, in ProcessGAMCommand
  File "gam.py", line 31631, in printFileList
  File "gam.py", line 3566, in _processGAPIpagesResult
KeyError: " key='CloudMigrator-Version' and value='3"

Delete sharedrive with items inside

Hi Ross,

Thank you for your amazing job !

I try to delete a sharedrive with this command :
gam user [email protected] delete teamdrive idxxx

And the result :
User: xxx, Shared Drive ID: xxx, Delete Failed: This resource cannot be deleted because it has children

Do we have to delete previously all the files and folders inside, then empty the trash and run the command?

Thank you
Pierre

When Using "others_folders" Shortcut, No List is Provided

When I run a command such as typed below:

gam user [email protected] print filelist others_folders

I get the following output:

Getting all Drive Files/Folders that match query (not 'me' in owners and mimeType = 'application/vnd.google-apps.folder') for [email protected] Got 1 Drive File/Folder that matched query (not 'me' in owners and mimeType = 'application/vnd.google-apps.folder') for [email protected]... Owner,name,webViewLink

I would expect to see data under the "Owner,name,webViewLink"

Crashing on filelist with a large number of results

Hello!
I'm experiencing crashes with large query results. I've tried using several different methods, but I haven't had success yet. Ultimately, I am trying to output all of the files which are shared from outside the organization. I have a pretty neat process, but it is choking sometimes on any output which contains more than 800k results. I think this has a high probability to be an issue with system resources, but I'm unsure. If you think it is too, I'll roll this into a forum post with more details regarding the resulting processes which I have found to be extremely efficient methods to mine the logs for data on a Windows platform.

My local environment:

Windows10 1809
Powershell ISE version 5.1

Using this command:

gam redirect stdout $outfile multiprocess redirect stderr $errorfile multiprocess batch $batchfile showcmds true 2>> $stderrfile

Batch file contents:

gam user user@domain print filelist showownedby others fields id,title,permissions,owners.emailaddress

To troubleshoot, I broke the command into separate processes with batches of 1 to try and rule out any limitations of powershell. I've also tried to split stderr out in a couple of ways in the hopes it would catch the error or number of files before the error occurred. It crashes with several users in our domain with access to many files.

Here's what was captured in the $errorfile log (stderr was very similar):

2020-04-03T13:37:36.661+00:00,0,Using 1 process...
2020-04-03T13:37:36.661+00:00,1,gam user user@domain print filelist showownedby others fields "id,title,permissions,owners.emailaddress"
2020-04-03T17:13:04.410+00:00,1,Complete
2020-04-03T17:13:04.425+00:00,0,Complete

Here's the Google Cloud Platform API usage over the duration of this users queries:
image

Here's my local system resource usage as it crashed:
image

Importing New Domain shared Contacts - Syntax Help Required

Kudos on extending Gam to handle this very useful feature. We have 615 domain shared contacts imported by a consultant 3 years ago that I can list using "gam info contacts". I've read through the docs but could not make any headway in deleting those and importing a fresh list. Hoping some can provide "simple" instructions to:

  1. bulk delete all these 615 shared contacts in one swoop
  2. import a new list of 384 current contacts in a csv - we only need 3 columns - firstname, lastname and email ID (belonging to another trusted domain). Actual syntax would be helpful for importing just one contact with only these 3 attributes - I can then batch gam it for the rest.

Any help would be deeply appreciated. Thanks!

Print ACLS for New Gsites

Hi

When I launch a print command on a file which is a Gsite on My Drive it shows me only :

  • owners
  • writers
  • domain

Readers are not print to my file !

Thanks

Passlib 1.7 deprecated

When creating a new user, I get the following :

c:\gamwork>gam csv add_students.csv gam create user ~user_name first name ~first_name lastname ~last_name password 'ChangeMe19' Using 1 process... gam.py:20966: DeprecationWarning: the method passlib.handlers.sha2_crypt.sha512_ crypt.encrypt() is deprecated as of Passlib 1.7, and will be removed in Passlib 2.0, use .hash() instead. User: [email protected], Created

Bulk Files - Restricted Toggle

Hi, please lmk if where I should post this if this is not the correct place for this question...

is there a way to bulk toggle all files marked as "Restricted" off and on?
i see 'restricted' flags and labels here, https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Drive-Files
but i can't seem to crack the syntax to make it spit out something that makes sense.
We ask bc these restricted files are a hard block on our migration project from GoogleDrive to O365-OneDrive.

createifnotfound adds new users to groups, but does not add existing users to groups

I'm using the following command to add users to groups:

~/bin/gamadv-xtd3/gam csv Users.csv gam update user ~email firstname ~firstname lastname ~lastname ou ~ou createifnotfound notify ~altemail password random groups ~group
Using 2 processes...
User: [email protected], Updated
User: [email protected], Created
User: [email protected], Add to 1 Group
Recipient: [email protected], Message: Account [email protected] password has been changed, Email Sent
  Group: [email protected], Member: [email protected], Added

In this case, [email protected] is an existing user, [email protected] is a new user being created.

[email protected] was not added to the group in the CSV file, but test4 was created with the group in the CSV file.

Is it expected behaviour that groups are set for new users, but not updated for existing users?

notify <email> doesn't work

Traceback (most recent call last):
File "gam.py", line 40960, in ProcessGAMCommand
File "gam.py", line 22167, in doCreateUser
File "gam.py", line 8285, in sendCreateUpdateUserNotification
KeyError: 'primaryEmail'

After the 4.88.04 update - this is the error message

As Super Admin, I cannot take ownership of a document.

I am trying to find and take ownership of a document.

Here is the command I use to find the document id...

gam user [email protected] show fileinfo query "name contains 'End of School Checkout List'" fields id,title

Here is the result:

Getting all Drive Files/Folders that match query (name contains 'End of School C heckout List') for [email protected] Got 1 Drive File/Folder for [email protected]... User: [email protected], Show 1 Drive File/Folder Drive File: End of School Checkout List (1JbT7g2MgOMEmJSw5amU_KpSugQe5ScRGG4cY UrZqoPs) id: 1JbT7g2MgOMEmJSw5amU_KpSugQe5ScRGG4cYUrZqoPs name: End of School Checkout List

I then run this:

gam user [email protected] create drivefileacl 1JbT7g2MgOMEmJSw5amU_KpSugQe5ScRGG4cYUrZqoPs user [email protected] role owner

and I get this.....

User: [email protected], Create 1 Drive File/Folder ACL User: [email protected], Drive File/Folder ID: 1JbT7g2MgOMEmJSw5 amU_KpSugQe5ScRGG4cYUrZqoPs, Create Failed: Permission ID: [email protected] Sorry, you do not have permission to share.

Any idea why I cant take ownership?

Unable to select different configuration

After upgrading to the latest version, I can no longer switch gam configurations using the "select" argument:

gam select default verify
ERROR: select is not a valid argument for "gam"

5.00.12 Python Error after upgrading

First time user of GAMADV, so no expert by any means. Have been using GAM for over 5 years though.

Installed 4.94.10 and had it working. Getting an error on the GAM CREATE CONTACT so decided to upgrade to the latest version, 5.00.12 and was unable to get it to run. The following error was produced:

Traceback (most recent call last):
File "Lib\site-packages\PyInstaller-4.0.dev0+3e6f7dc709-py3.8.egg\PyInstaller\loader\rthooks\pyi_rth_certifi.py", line 13, in
File "C:\python\lib\site-packages\pyinstaller-4.0.dev0+3e6f7dc709-py3.8.egg\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module
File "ssl.py", line 98, in
ImportError: DLL load failed while importing _ssl: The specified module could not be found.
[12152] Failed to execute script pyi_rth_certifi

Downloaded and installed 5.00.11 and code ran without any errors.

System is Windows 10
Installed Python 3.7 and 3.8 just to see if maybe I needed python installed. Didn't help.
When I upgrade, how I do it with GAM, is just download the latest zip and extract it to the folder. If required, I'll run any commands to update the project if needed. This seems to work for this version as well, but I see it has many more options.

Error with gam csv

Hello,

Gam csv "name of csv file" now throws an error: unknown encoding: C:\GAM
GAM csv throws the same error for everything.
See script and error below

c:\gamadv-xtd3>gam csv xyz.csv - gam update group [email protected] delete members ~Email

ERROR: unknown encoding: C:\GAM


Thanks in advance for any help

"Sign in with Google temporarily disabled for this app" error during installation

This error occurs when I run the gam update project command, while working through the How to Upgrade from Standard GAM wiki page. Instead of a Google page prompting me to authorize GAM to access my data, I get an error page from Google reading:

Sign in with Google temporarily disabled for this app
This app has not been verified yet by Google in order to use Google Sign In.

This appears to be the same problem as reported in Issue 1050 on the standard GAM project, and a screenshot of the error page is attached to this StackOverflow question.

Fortunately the solution given there by jay0lee to whitelist the GAM Creation project allowed me to move past this error, but I wanted to raise the issue here as well.

Edit group subject prefix

How can I edit the group subject prefix found under Settings โ†’ Email Options in the Classic Groups?
image

I also didn't find that in the Group Settings API but I found an issue for that, please everybody star.

Does anybody know of a solution to automate that?

Maybe keep this issue open so that users can easily find it and go to star the issue for the missing API.

cannot add sendas default...sometimes

After issuing the command gam create alias [email protected] user [email protected]

We own both domains and have been using them for three years or so now.

I then issue the command
gam user [email protected] add sendas [email protected] "Anne User" default

Sometimes this works and sometime it doesn't.
Sometimes it works after I try two or three times.
This happens whether it is one account or multiple accounts.

Today for example I had a csv of some 50 or so accounts to create and configure.

Using gam csv the first run failed on all of the accounts but at the second time of asking I ended up with 22 failures and almost 30 successes.

The error message is always

Add Failed: Unverified send-as cannot be set as the default

This has happened on and off over the years and most issues I have turned up online have been as a result of not creating the alias or not owning the domains. Neither applies to us.

Can anyone help?

Is there a way to verify the send-as from gam?

I have reverted to signing in as the user on past occasions and verifying the email address from the link in the email in the inbox or manually setting the send-as in settings.

Updating Wiki Page "ChromeOS Devices"

I didn't just want to update the wiki page without letting folks know. I was struggling to find the items you can use in the query flag for ChromeOS devices. Google's latest page change seems to have removed the field definitions, so using wayback machine I was able to grab them.
As I was adding them, my markdown linter was going crazy and also allowed me to clean somethings up on the wiki page. I wanted to share it before adding and seeing if everyone was ok with the edit proposed. See gist here for the page.

https://gist.github.com/WardsParadox/b7ab1362f7a6f7ae2024b5de09feb8cc

Error reading Google Response or writing to custInfo.json

We tried using the gam create resoldcustomer command to create a new customer but it attempted to read/write to a seemingly undocumented custInfo.json file. Even if we pre-create the create the file in the same directory, it still causes an error:

Traceback (most recent call last):
File "gam.py", line 42810, in ProcessGAMCommand
File "gam.py", line 8901, in doCreateResoldCustomer
File "json/init.py", line 357, in loads
File "json/decoder.py", line 337, in decode
File "json/decoder.py", line 355, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

My guess is that it fails to read the response from the Google API and thus, throws an exception. We tested this on Ubuntu 18.04 LTS on Python 3.6.8

Deleted classes not being deleted

Hi

Classes that have been deleted using "gam delete course " are still appearing when executing "GAM print courses". This would be a minor inconvenience, but this prevents "GAM print courses alias" as when GAM gets to one of the deleted classes it returns "ERROR: 404: notFound - Requested entity was not found."

can't create oauth2.txt using gam oauth create

Hi, Hope someone can help?

After creating a new GAM project and then running GAM oauth create, i click the allow api access button and then get a Authorization error invalid request account restricted. i've attached a screen shoot of the error.

i manage a number of domains, some have authorised without problems and some get the above error..i'm a little lost. it seems google has changed API permissions recently and i'm wondering whether this has anything to do with it.
error

DeprecationWarning python 3.7.1

Python 3.7.1 64-bit final (on Mac):

I get these warnings on all commands:
gam.py:2303: DeprecationWarning: 'U' mode is deprecated
with open(fileName, u'rU') as f:
gam.py:2304: DeprecationWarning: This method will be removed in future versions. Use 'parser.read_file()' instead.
config.readfp(f)

It seems to work fine if I change to this:
2303 with open(fileName, u'r') as f:
2304 config.read_file(f)

/Mattias

Error using update photo

Hi
Im getting this error

ERROR: Object of type 'bytes' is not JSON serializable

My command : gam user xxxxxx update photo xxxxxx.jpg

gamx update schema failing

Gamx should be able to add new fields to schemas. I'm currently getting 'does not exist'. Verified that the same command on the same schema w/ same values works for jay's 'gam' command:

$ gamx version
GAM 4.86.03 - https://github.com/taers232c/GAMADV-XTD3

$ gamx update schema Entitlements field foocloud indexed type bool endfield
Schema: Entitlements, Update Failed: Does not exist

$ gam version
GAM 4.40 - https://git.io/gam

$ gam update schema Entitlements field foocloud indexed type bool endfield
Updated user schema Entitlements

Allow using external mail service to send notification emails (Gmail API has strict sending limits).

I'm currently trying to batch-create a large number of users (~3000).

The ability to send the welcome email in GAM-X is awesome.

However, it GAM-X uses the Gmail API directly, which has very strict sending limits - these are on top of the API limits, and cannot be changed:

https://support.google.com/a/answer/166852?hl=en

Is there any way to use an external SMTP server, or mail service, to send these notification emails?

It would be great if this could be configurable, as you could point it to a mail service (e.g. Sendgrid), that did not have such limits.

Errbo 13 - Permission denied

When running

gam user [email protected] show fileinfo query "name contains 'Aft er School 2018-2019'" fields id,title

I Get the following error:

ERROR: Connection error: [Errno 13] Permission denied: 'C:\\gamcfg\\gamcache\\ww w.googleapis.comdiscoveryv1apisdrivev3rest,9df7bd48bf964bd41ab30be7084dc28e'

Not sure exactly what this means?

I am trying to find this file, and take ownership of the file....My best guess is the error I get means this file has been trashed?

can't delegate a mailbox in google Cloud shell

Creating or printing user delegations doesn't work. I tired different Cloud Shells, different G Suite Domains and and different users.

me@cloudshell:~/.gam$ gam user old.user delegate to sysadmin
User: [email protected], Service not applicable/Does not exist
me@cloudshell:~/.gam$ gam user old.user print delegates
User: [email protected], Service not applicable/Does not exist
User,delegateAddress,delegationStatus
me@cloudshell:~/.gam$ gam version
GAM 4.83.04 - https://github.com/taers232c/GAMADV-XTD
Ross Scroggs <[email protected]>
Python 2.7.16 64-bit final
google-api-python-client 1.7.8
httplib2 0.12.1
oauth2client 4.1.3
Linux-4.14.104+-x86_64-with-debian-9.9 x86_64
Path: /home/me/bin/gamadv-xtd

Getting Authorization Error Error 400: invalid_request Account restricted

Getting this error when running gam config no_browser true oauth create

So I started of by unselecting all and then adding scopes one by one (except for ' Pub / Sub API' and 'Reseller API' - those are unselected by default). With a lot of trial and error, I found out that I only get this error when enabling the scope 'Classroom API - Course Topics'.

For the time being, I don't need that one but it might affect some other people.

Error 500: 500 - Internal Error Encountered

Encountering a hard stop error when running "create course" command when copyfrom is included. Verified content is stored in a user's personal Google Drive and shared so that anyone with the link can view. Happy to provide screenshots, code snips, or anything else as needed.

Creation of a particular SubOrg

Hi

I use a filter to get all chrome licences on my Admin console and it seems there is a bug because now when I check my OU I can see a new sub Org Called "temp-delete-me"

"D:\GAM Global\gam.exe" select admin_export redirect csv D:\0-OUT\ChromeOS\ou_chrome_devices.csv multiprocess csv D:\0-OUT\ChromeOs\out.csv gam print org fromparent "~OU Gsuite" mincroscount 1 fields orgUnitPath,name showparent toplevelonly batchsuborgs False

Thanks

Refactoring?

Hi Ross,
I'd like to contribute more to this tool (potential ideas include writing tests, more helpful exception messages, a gui/cli tool with prompts, amongst others) but the file size of the main gam.py is pretty unwieldy. Would you be open to me breaking it into some smaller modules that might be a little easier to work with?
I'm also going to try to contribute some sample commands to the docs when I figure them out. Some areas of the wiki are super helpful, and others are pretty sparse. All of which is incredibly helpful! Not meaning to be picky about a fantastic open source project, but just willing to contribute back if it's desired.

can't schedule gamadv-xtd3 with cron

Hello,

I schedule a gam claim ownership every day, but it seems that it is not working.

The log states:

 ==> 2019-07-25 09:48:01 Claiming ownership for: [email protected]

ERROR: Connection error: [Errno 101] Network is unreachable

the error happens after about 45 minutes, ever time.

Doing it interactively on BASH prompt doesn't give any error.

Any idea?

Update Sheet

I am trying to update a specific sheet within a Google sheet. Based on the documentation I think the syntax should be the following, but I receive the error: "User: [email protected], Update 1 Drive File/Folder
User:[email protected], Service not applicable/Does not exist

gam user [email protected] update drivefile id gsheet id: localfile ./myfile.csv

I am not sure if my syntax is wrong, there is a bug in the program, or I am trying to do something that is unsupported.

sendemail: From display name

Hey Ross,
Would like to implement a nicer sendemail that uses the display name of the user, rather than just the e-mail address for the "From" field. Should be a simple f-string replacement, but I don't want to bork a bunch of other stuff in the process! Want to point me in the right direction?
Ryan

Windows x64 - GAMERROR: [Errno 24] Too many open files

Hi Ross,

Thanks again for all your work on this script, it's appreciated globally!

I'm seeing an issue on Windows devices (presume all but Windows 10 Pro v1909 here) when running multiprocess commands on large amount of users.

GAMADV-XTD3 4.99.25 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs [email protected]
Python 3.8.1 64-bit final
google-api-python-client 1.7.11
httplib2 0.16.0
oauth2client 4.1.3
Windows 10 10.0.18362 AMD64

gam config redirect csv ./tokenslist.csv multiprocess csv userlist.csv gam user print tokens
(didnt auto_batch_min this)

When it gets up to 49K users the tool will get stuck in a loop:
ERROR: File: C:\Users\user.gam\oauth2.txt, [Errno 24] Too many open files: 'C:\Users\user\.gam\oauth2.txt.lock'

This will happen multiple times and then it will just repeat the vague
ERROR: [Errno 24] Too many open files
ERROR: [Errno 24] Too many open files

again and again etc.

Doesnt happen on ubuntu

Can reproduce if needed for extra debug logs, just takes a while :) Be great to solve this if you can!

Thanks
Damion

Progress indicator doesn't clean previous line content

In Advanced GAM, progress indicator is diplayed in the same line, changing as more users are downloaded. However, since email addresses have different lengths, after several updates, the status line shows relicts from previous updates like this:

gam print users
Getting all Users, may take some time on a large G Suite Account...
Got 6500 Users: [email protected] - [email protected]mple.com

To fix: it's necessary to print a special terminal control sequence "clear to end of line" after each progress update. This sequence is defined by tput el.

Printing group members recursively causes an exception since recent commit

When running, e.g., gam print group-members group [email protected] recursive, the following error message is now received:

Getting all Members, Managers, Owners for [email protected]
Traceback (most recent call last):
File "gam.py", line 43455, in ProcessGAMCommand
File "gam.py", line 17743, in doPrintGroupMembers
File "gam.py", line 5176, in MoveTitlesToEnd
ValueError: list.remove(x): x not in list

Expected behavior is a printed list of all members in the group (recursively).

This seems to be caused by e9e43e7#diff-f5ee7a4a2256c192bffeb8eaa0da15eeR5181

gam print cros issue

First of all, Ross, thanks so much for all that you do. I rely heavily on your documentation to get my job done and I'm forever grateful.

I have been using this modification of the gam print cros command every since the chromebookinventory add-on was disabled. I know Kim made something and maybe I should just use that instead, but, using the GAM command has been getting the job done for me. I ordered it as follows:
gam print cros orderby lastsync fields orgUnitPath,annotatedUser,annotatedLocation,annotatedAssetId,notes,serialNumber,macAddress,ethernetMacAddress,deviceid,status,model,firmwareversion,lastsync,osversion,bootmode,supportenddate todrive

I last used it on Feb 12 and had gamadv-xtd3-4.98.14-windows-x86_64 installed. I went to use it yesterday, and some times I get 402 results, sometimes 602, sometimes 1102, but never the 6152 total devices no matter what their state. I have the device_max_results = 200 and installed gamadv-xtd3-4.99.20-windows-x86_64 yesterday and gamadv-xtd3-4.99.22-windows-x86_64 today with no difference. If I run the same command and remove the "todrive" it still returns a random amount of results every time. Lastly, if I run gam print cros todrive or gam print cros allfields todrive it works without issue.

how to update chromebook orgUnitPath with list of devices

If I have a csv file with chromebook serial numbers, and I want to move all these devices into a specific OU, how could I achieve this with GAM ADV XTD3. For my case use, the csv file is called cow2.csv and has a header of serial (With Chromebook Serial Numbers).... the OU I want to move them to is /COWS/COW2
i am thinking something along these lines...
...
....
gam csv cow2.csv gam update cros ~serial orgUnitPath "/COWS/COW2"

When I try this it says:

"Add failed: Does not exist"

redirect multiprocess hangs sometimes for large batch file on windows 2012 server

Hi,

I am executing the following command
gam.exe redirect stdout stdout.txt multiprocess redirect stderr stderr.txt multiprocess batch test.csv

where test.csv contains about 31000 lines of

gam print group-members group [email protected]
gam print group-members group [email protected]
...
gam print group-members group [email protected]

This takes normally about 30 minutes (with 10 threads).

Sometimes (about 1 out of 10-20) the command hangs with the following symtoms

  • stderr.txt and stdout.txt are created with 0 bytes.
  • process manager shows all gam.exe processes
  • when i kill the gam.exe process tree (all gam processes are killed) both stderr.txt and stdout.txt are written and filled with normal output (so all group members are listed in the stdout.txt file and all "Getting all Members, Managers, Owners for..." lines are listed in the tsderr.txt file ) except for the last lines in stderr.txt
Using 10 processes...
Processing item 100
....
Processing item 30700

which are missing.

So it seems that the "master" gam process hangs somewere after all subprocesses are finnished normally and theire stdout+stderr are writen to the output/stderr streams (they show 0 bytes but are locked and probably alread written) but before writing its own stderr to the output stream.

How can i circumvent this error or debug this?

I am running this on a windows 2012 server

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.