Skip to content

Users Drive Orphans

Jay edited this page Sep 3, 2021 · 13 revisions

Users - Drive - Orphans

API documentation

Definitions

See Drive File Selection for symbols not listed here, such as <DriveFileEntity>

<DomainName> ::= <String>(.<String>)+
<EmailAddress> ::= <String>@<DomainName>
<UniqueID> ::= uid:<String>
<UserItem> ::= <EmailAddress>|<UniqueID>|<String>

<DriveFileName> ::= <String>
<DriveOrderByFieldName> ::=
        createddate|createdtime|
        folder|
        modifiedbyme|modifiedbymedate|modifiedbymetime|modifiedbyuser|
        modifieddate|modifiedtime|
        name|
        name_natural|
        quotabytesused|quotaused|
        recency|
        sharedwithmedate|sharedwithmetime|
        starred|
        title|
        title_natural|
        viewedbymedate|viewedbymetime

Collect orphaned files

Collect a users orphaned Drive files/folders into a target folder; only orphaned files not in the trash are processed.

gam <UserTypeEntity> collect orphans
        [(targetuserfoldername <DriveFolderName>)|(targetuserfolderid <DriveFolderID>)]
        [useshortcuts [<Boolean>]]
        (orderby <DriveOrderByFieldName> [ascending|descending])*
        [preview] [todrive <ToDriveAttribute>*]
  • targetuserfoldername <DriveFileName> - This is the parent folder name for the orphaned files; the default is "#user# orphaned files". In this string, #user# and #email# will be replaced by the source user email address, #username# will be replaced by the source user mail address without the domain. This folder will be created is necessary.
  • targetuserfolderid <DriveFolderID> - This is the parent folder ID for the orphaned files; it must exist.
  • useshortcuts false - Add the target user folder as a parent of an orphan; this is the default behavior. This may now fail as the orphan may have parents belonging to other users and files can now have only one parent.
  • useshortcuts or useshortcuts true - Put a shortcut to the orphan into the target user folder and do not modify the orphan's parents. GAM will not duplicate an existing shortcut.
  • orderby <DriveOrderByFieldName> [ascending|descending])* - Specify the order in which files are processed.
  • preview - If preview is specified, no files are collected; a CSV file listing the files to be collected is output.

Example

Collect a users orphaned files into the folder "Orphans - testuser@domain.com" on their Drive; use shortcuts rather than changing the orphan's parents.

gam user testuser@domain.com collect orphans targetuserfoldername "Orphans - #user#" useshortcuts

Update History

Installation

Configuration

Notes and Information

Definitions

Command Processing

Collections

Client Access

Special Service Account Access

Service Account Access

Clone this wiki locally