google-apps-script - ReferenceError:未定义“AdminDirectory”
问题描述
我正在使用示例脚本来创建用户,但它不断收到此错误 ReferenceError: "AdminDirectory" is not defined
/**
* Adds a new user to the domain, including only the required information. For
* the full list of user fields, see the API's reference documentation:
* @see https://developers.google.com/admin-sdk/directory/v1/reference/users/insert
*/
function addUser() {
var user = {
primaryEmail: 'liz@mydomain.com',
name: {
givenName: 'Elizabeth',
familyName: 'Smith',
},
// Generate a random password string.
password: Math.random().toString(36),
};
user = AdminDirectory.Users.insert(user);
Logger.log('User %s created with ID %s.', user.primaryEmail, user.id);
}
解决方案
推荐阅读
- c# - Asp .Net MVC 中枚举的 Html 助手
- javascript - 在 Angular 聊天组件中使用 apollos subscribeToMore 方法进行订阅时,未处理的 GraphQL 订阅错误
- r - 错误:不支持`dim<-.haven_labelled()`
- javascript - 如何阻止事件触发两次?
- javascript - reactjs中如何从url获取参数?
- documentation - 是什么导致 sphinx 输出“警告:意外缩进”?
- ios - CADisplayLink 计时器无法正常工作 | 迅速
- rust - AssertUnwindSafe 如何与 CatchUnwind 未来一起使用
- ios - 我的 swift iOS 应用程序总是在 MainViewController 中启动 - 最初无法在 SceneDeletage 中导航到 LoginViewController
- sqlite - SQLite 浏览器“修改表后检查外键时出错。更改将被还原。”