Hi Lukas,
Thanks for creating and sharing this script and all of your gcp-tools it is very much appreciated. I'm getting the error below despite the client id for the service account having been granted the needed 2lo scopes in the G Suite console.
Retrieving users from Google Admin SDK Directory API...
Traceback (most recent call last):
File "C:\gcp-tools\import_projects.py", line 315, in
main()
File "C:\gcp-tools\import_projects.py", line 273, in main
users = get_domain_users(admin)
File "C:\gcp-tools\import_projects.py", line 109, in get_domain_users
users = admin.get_users()
File "C:\gcp-tools\lib\google.py", line 488, in get_users
users_list = request.execute()
File "C:\Python27\lib\site-packages\oauth2client_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "C:\Python27\lib\site-packages\googleapiclient\http.py", line 836, in execute
method=str(self.method), body=self.body, headers=self.headers)
File "C:\Python27\lib\site-packages\googleapiclient\http.py", line 167, in _retry_request
resp, content = http.request(uri, method, *args, **kwargs)
File "C:\Python27\lib\site-packages\oauth2client\transport.py", line 159, in new_request
credentials._refresh(orig_request_method)
File "C:\Python27\lib\site-packages\oauth2client\client.py", line 749, in _refresh
self._do_refresh_request(http)
File "C:\Python27\lib\site-packages\oauth2client\client.py", line 819, in _do_refresh_request
raise HttpAccessTokenRefreshError(error_msg, status=resp.status)
oauth2client.client.HttpAccessTokenRefreshError: unauthorized_client: Client is unauthorized to retrieve access tokens using this method.