I would like to change the owner of a file in google apps script. I tried following code:
function changeOwner() {
var file = DriveApp.getFileById("id");
file.setOwner("[email protected]");
}
It generate an exception error: Argument is not valid. [email protected] is not a member of my organisation.
Could you help me to transfer ownership to a user outside my organisation?
You are not allowed to transfer ownership of a file on your personal Drive to a user outside of your organization
If you try - you will receive the aforementioned error: