Removing resources during data transfer

18 views
Skip to first unread message

rd...@yext.com

unread,
Feb 2, 2018, 11:27:14 AM2/2/18
to gshell-discuss
I'm having some trouble using the REMOVE_RESOURCES parameter in the data transfer API when I'm trying to transfer calendars from one user to another. The rooms seem to stick and not get removed unlike when I do it from the GSuite admin console.

Anyone else seeing this?

rd...@yext.com

unread,
Feb 6, 2018, 11:18:27 AM2/6/18
to gshell-discuss
If this helps anyone - here is the code I came up with

It transfers Calendar events from the users primary calendar and removes any resources attached to those meetings, transfers drive and Google + page (and Google My Business accounts)

Rishi


$CalParams = New-GDataTransferApplicationParamObj -Key RELEASE_RESOURCES -Value true

$DriveParams = New-GDataTransferApplicationParamObj -Key PRIVACY_LEVEL -Value shared,private

$CalendarDataObject = New-GDataTransferApplicationDataObj -ApplicationId 435070579839 -ApplicationTransferParams $CalParams

$DriveDataObject = New-GDataTransferApplicationDataObj -ApplicationId 55656082996 -ApplicationTransferParams $DriveParams

$GooglePlusDataObject = New-GDataTransferApplicationDataObj -ApplicationId 553547912911

#create new Data Transfer Object

$TDO = New-GDataTransferDataObj `
-OldOwnerUserId $OldOwner.userObject.ID `
-NewOwnerUserId $NewOwner.userObject.ID `
-ApplicationDataTransfers $CalendarDataObject,$DriveDataObject,$GooglePlusDataObject

$Transfer = New-GDataTransfer -DataTransferBody $TDO

Get-GDataTransfer -DataTransferId $transfer.Id

Reply all
Reply to author
Forward
0 new messages