I'm trying to write a PowerShell script that will transfer ownership of all Google Drive files/docs to a new user but I've not been able to get anything working with the Data Transfer cmdlets.
Has someone got a working example to transfer ownership of google drive data from one user to another?
Thanks,
Rishi
--
You received this message because you are subscribed to the Google Groups "gshell-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gshell-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#app ID pulled from https://developers.google.com/admin-sdk/data-transfer/v1/parameters$app = Get-GDataTransferApplication -ApplicationId 55656082996
$OldOwner = get-gauser -UserKey $User$NewOwner = get-gauser -UserKey $targetUser
#Without paramobj, no data was actually transferred$ApplicationParams = New-GDataTransferApplicationParamObj -Key PRIVACY_LEVEL -Value SHARED,PRIVATE$ApplicationDataObject = New-GDataTransferApplicationDataObj -ApplicationId $app.Id -ApplicationTransferParams $ApplicationParams#create new Data Transfer Object
$TDO = New-GDataTransferDataObj ` -OldOwnerUserId $OldOwner.userObject.ID ` -NewOwnerUserId $NewOwner.userObject.ID ` -ApplicationDataTransfers $applicationDataObject
$Transfer = New-GDataTransfer -DataTransferBody $TDO
Get-GDataTransfer -DataTransferId $transfer.Id