I am trying to print users based on first and last name to get their email addresses. I can successfully use the command gam print users query givenName:Bill familyName:Smith and it prints the users email address. I have a large spreadsheet of users to remove but I only have first and last name. The name of the file is remove.csv. I am attempting to parse in the first and last name using the following command so that I can print out email addresses to delete the accounts.
I have tried adding the ' and " in multiple locations and get the same error.
I tried parsing with just givenName and got the following error.
C:\gam>gam csv remove.csv gam print users query givenName:~first
starting 5 worker threads...
Traceback (most recent call last):
File "<string>", line 9366, in <module>
File "<string>", line 7489, in doPrintUsers
File "<string>", line 813, in buildGAPIObject
File "C:\Users\jlee\Documents\GitHub\gam363\src\build\gam\out00-PYZ.pyz\oauth2client.util", line 137, in positional_wrapper
File "C:\Users\jlee\Documents\GitHub\gam363\src\build\gam\out00-PYZ.pyz\googleapiclient.discovery", line 203, in build
File "C:\Users\jlee\Documents\GitHub\gam363\src\build\gam\out00-PYZ.pyz\googleapiclient.discovery", line 249, in _retrieve_discovery_doc
File "C:\Users\jlee\Documents\GitHub\gam363\src\build\gam\out00-PYZ.pyz\oauth2client.client", line 622, in new_request
File "C:\Users\jlee\Documents\GitHub\gam363\src\build\gam\out00-PYZ.pyz\httplib2", line 1592, in request
File "C:\Users\jlee\Documents\GitHub\gam363\src\build\gam\out00-PYZ.pyz\httplib2", line 448, in _updateCache
File "C:\Users\jlee\Documents\GitHub\gam363\src\build\gam\out00-PYZ.pyz\httplib2", line 715, in set
IOError: [Errno 22] invalid mode ('wb') or filename: u'c:\\gam\\gamcache\\
www.googleapis.com,discovery,v1,apis,admin,directory_v1,rest,8dd26d939e03904b2171db8fe001343c'
C:\gam>gam csv remove1.csv gam print users query givenName ~first familyName ~last
starting 5 worker threads...
ERROR: Kyrie is not a valid argument for "gam print users"
ERROR: Zachary is not a valid argument for "gam print users"
ERROR: Layla is not a valid argument for "gam print users"
ERROR: Jacarria is not a valid argument for "gam print users"
ERROR: Zachary is not a valid argument for "gam print users"
ERROR: Brandon is not a valid argument for "gam print users"
C:\gam>gam csv remove1.csv gam print users query givenName '~first' familyName ~last
starting 5 worker threads...
ERROR: '~first' is not a valid argument for "gam print users"
ERROR: '~first' is not a valid argument for "gam print users"
ERROR: '~first' is not a valid argument for "gam print users"
ERROR: '~first' is not a valid argument for "gam print users"
ERROR: '~first' is not a valid argument for "gam print users"
ERROR: '~first' is not a valid argument for "gam print users"
C:\gam>gam csv remove1.csv gam print users query givenName=~first familyName=~last
starting 5 worker threads...
ERROR: familyName=~last is not a valid argument for "gam print users"
ERROR: familyName=~last is not a valid argument for "gam print users"
ERROR: familyName=~last is not a valid argument for "gam print users"
ERROR: familyName=~last is not a valid argument for "gam print users"
ERROR: familyName=~last is not a valid argument for "gam print users"
ERROR: familyName=~last is not a valid argument for "gam print users"
C:\gam>gam csv remove1.csv gam print users query 'givenName=~first familyName=~last'
starting 5 worker threads...
ERROR: familyName=~last' is not a valid argument for "gam print users"
ERROR: familyName=~last' is not a valid argument for "gam print users"
ERROR: familyName=~last' is not a valid argument for "gam print users"
ERROR: familyName=~last' is not a valid argument for "gam print users"
ERROR: familyName=~last' is not a valid argument for "gam print users"
ERROR: familyName=~last' is not a valid argument for "gam print users"
C:\gam>gam csv remove1.csv gam print users query 'givenName=~first and familyName=~last'
starting 5 worker threads...
ERROR: and is not a valid argument for "gam print users"
ERROR: and is not a valid argument for "gam print users"
ERROR: and is not a valid argument for "gam print users"
ERROR: and is not a valid argument for "gam print users"
ERROR: and is not a valid argument for "gam print users"
ERROR: and is not a valid argument for "gam print users"
Is it possible to do this? If so, where am I going wrong? I have a feeling I just need " somewhere. Thank you for any help you can provide.