当前位置: 动力学知识库 > 问答 > 编程问答 >

Not Authorized to delete a user with Google script

问题描述:

I'm trying to delete a User from our Google domain (G Suite for Education) with Google script inside a Drive-Project. I'm logged on as the 'super-admin', have activated APIs for the Project etc. I can create users, add group membership, set OU-path etc.

When I try to delete a test user with the same Project I'm "not authorized"?

Code:

var userEmail = '[email protected]';

var user = AdminDirectory.Users.get(userEmail);

user = AdminDirectory.Users.remove(user);

Logger.log('User: ' + userEmail + ' deleted.');

Any ideas?

Sorry if this is a stupid question! I'm a Google script-beginner. ;-)

Kind regards,

/Sverker (Sweden)

分享给朋友:
您可能感兴趣的文章:
随机阅读: