How can an Admin access the Google Drive contents of all the users in a particular domain?

Files.list will retrieve all the user’s files, in this case it will get all your own files. In order for that query to work would be only if that user is also owner one of your files.

HTTP request

GET https://www.googleapis.com/drive/v2/files

Even as an admin you cannot access users files directly.

To access other user’s files, as an admin you need to impersonate the users and then perform actions in their behalf.

This is achieved by using a service account with domain wide delegation of authority.

Typically, an application uses a service account when the application uses Google APIs to work with its own data rather than a user’s data. For example, an application that uses Google Cloud Datastore for data persistence would use a service account to authenticate its calls to the Google Cloud Datastore API.

Google Apps domain administrators can also grant service accounts domain-wide authority to access user data on behalf of users in the domain.

Here’s a related SO ticket, discuss the most efficient process for transferring of users files: Most efficient process for transferring ownership of all of a user’s files using the Google Drive API

Leave a Comment