backup - How do I restore deleted documents from shared Google Drive folders? -


a non-privileged google drive user has accidentally removed large number of files folders shared across organisation. not have permission delete files entirely, because not owner. however, users edit permissions able remove file shared folder. returns user owner, seems leave file orphaned without parent folder.

the files owned various different users.

how restore these files correct folders? google drive audit log not contain enough information restore folders correctly - parent folder id not included "remove folder" event.

google drive included in reports api of google apps admin sdk. provides similar information google drive audit log, additional metadata. includes parent folder id of files removed.

to restore files should first query reports api files removed user in question on relevant time period, using activities:list method.

then you'll need setup google apps service account (which little confusing), allow impersonate owners of documents removed.

lastly, can iterate on event report removed files , use files: patch method in google drive rest api, re-add parent id's each of files.


see gist using google drive api restore files removed shared folders example of last step.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -