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

3

7

I am developing a tool to automate the transfer of ownership of Google Drive documents from one user to another using Admin SDK which is run by the admin. I used the Data transfer API for the ownership transfer. I wanted to validate the transfer by checking the size/number of the google drive documents before and after the transfer for which the admin account must be able to access the Google Drive contents of all the users in the domain. Is there a way to do that? Or is there a better way to validate the data transfer?

I tried using the Drive API service for validating purposes by setting the 'key' to the target user account. All my attempts with the Drive API so far retrieved the Admin's Drive contents.

Repression answered 2/6, 2016 at 22:5 Comment(0)
G
11

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

Geordie answered 3/6, 2016 at 16:40 Comment(0)
R
1

I'm not sure why this hasn't been the correct answer.

  1. Go to google Vault
  2. Click on Matters
  3. Create a new matter (just put in whatever name you want)
  4. In service drop-down click Drive
  5. If you want the drive of a specific person, click on Entity and pick the email address
  6. Fill in your date ranges
  7. Click search
  8. Now you have access to all the documents in there
Rookie answered 28/4, 2023 at 17:0 Comment(0)
A
-1

Use Google Vault, Matters, Search Drive, Source All Data, Entitiy Specific Accounts, (User Account) put in the account you want to pull up. Then search.

You will see a list of all the documents the user has accessed with a date/time stamp.

Agamogenesis answered 2/3, 2022 at 16:1 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Knighthead

© 2022 - 2024 — McMap. All rights reserved.