google-admin-sdk 相关问题

Google Admin SDK允许开发人员编写应用程序来管理G Suite域,从现有IT基础架构迁移和集成,创建用户,更新设置,审核活动等。

如何管理 Google Workspace 中的已归档帐号?

我对 Google 世界非常陌生,正在尝试完成一些自动化,看看下面的内容是否适用于应用程序脚本。我也不是Java人,所以我尽力了。我们使用 Okta 作为我们的 SSO。一旦成为用户

回答 1 投票 0

判断用户是否为群组成员

背景 我们的企业用户拥有 Google Apps 帐户。我们希望允许他们(并且只有他们)使用 Google 帐户登录酒店后台。理想情况下,我们也想管理

回答 1 投票 0

无法使用 Google Admin SDK Directory API 和服务帐户访问用户数据

我在尝试通过服务帐户使用 Google Admin SDK Directory API 访问用户数据时遇到问题。这是场景: 我有一个利用 Google ...

回答 1 投票 0

如何在我的 flutter 中实现 Admin SDK,以便我可以从管理面板管理用户?

我刚开始从事我的毕业项目。我想在我的应用程序中实现管理功能。到目前为止,我已经实现了数据流和身份验证,但我陷入了

回答 2 投票 0

Google 工作负载身份联合调用目录 API

我正在尝试使用 AWS 设置 Google Identity Federation,以便从 aws lambda 函数进行 admin.directory API 调用。它是用 Java 编写的。 我设置了工作负载池,创建了服务帐户并

回答 1 投票 0

管理控制台的 Google API 存在吗?

我需要以编程方式检查管理控制台中的设置是否打开或关闭。 例如: 1. 以管理员身份登录admin.google.com。 2. 选择应用程序。 3. 选择 Google Workspace。 4. 选择 Gmail。 5.

回答 1 投票 0

用于请求用户列表的 C# Google API 返回“badRequest”

我这几天一直在寻找这方面的信息。我相信我已正确设置与 API 相关的所有内容以供访问,但我不断收到此错误: 服务管理员有...

回答 1 投票 0

检索用户的所有组 ->Google Directory API

我正在尝试创建一个页面,我的 NGO 内的用户可以使用其 GSuite 帐户登录。他们的组成员身份将决定他们可以看到页面的哪些部分。当我年轻的时候,我...

回答 1 投票 0

通过 Google API 获取 Google Org 中的所有日历

目标:我正在尝试获取我的 Gsuite 组织中的所有日历。 问题:我知道我可以使用 CalendarList.list 获取日历列表,但前提是用户或服务帐户拥有所有日历...

回答 3 投票 0

来自 Google Workspace 的用户邮箱使用情况报告

我正在尝试获取基本的电子邮件使用情况报告。我们需要获取用户名及其电子邮箱的大小。下面提供的代码抛出异常 ” 我正在尝试获取基本的电子邮件使用情况报告。我们需要获取用户名及其电子邮箱的大小。下面提供的代码抛出异常 ”https://admin.googleapis.com/admin/directory/v1/users?alt=json 返回“错误请求”。详细信息:“[{'message': '错误请求', 'domain': ' global', 'reason': 'badRequest'}]">**" 就行了 users = service.users().list().execute() 完整代码如下: from __future__ import print_function import os.path import csv import io from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build # If modifying these scopes, delete the file token.json. #SCOPES = ['https://www.googleapis.com/auth/admin.directory.user.readonly'] SCOPES = ['https://admin.googleapis.com/admin/directory/v1/users'] creds = None # The file token.json stores the user's access and refresh tokens, and is # created automatically when the authorization flow completes for the first # time. if os.path.exists('token.json'): creds = Credentials.from_authorized_user_file('token.json', SCOPES) # If there are no (valid) credentials available, let the user log in. if not creds or not creds.valid: if creds and creds.expired and creds.refresh_token: creds.refresh(Request()) else: flow = InstalledAppFlow.from_client_secrets_file( 'credentials.json', SCOPES) creds = flow.run_local_server(port=0) # Save the credentials for the next run with open('token.json', 'w') as token: token.write(creds.to_json()) service = build('admin', 'directory_v1', credentials=creds) print('Getting users in the domain') users = service.users().list().execute() # Create a dictionary to store the user data. user_data = {} # Iterate over the list of users and get their first name, last name, and mailbox size. for user in users["users"]: user_data[user["primaryEmail"]] = { "firstName": user["name"]["givenName"], "lastName": user["name"]["familyName"], "mailboxSize": user["storage"]["quotaUsage"], } # Open the CSV file for writing. with open("user_data.csv", "w", newline="") as f: writer = csv.writer(f) # Write the header row. writer.writerow(["email", "firstName", "lastName", "mailboxSize"]) # Iterate over the user data and write each user's data to a new row in the CSV file. for email, data in user_data.items(): writer.writerow([email, data["firstName"], data["lastName"], data["mailboxSize"]]) # Close the CSV file. f.close() 凭证正确。测试多次。正如您从示例中看到的,我尝试使用不同的范围。 我在这里做错了什么? 你错过了你的customer='my_customer': from __future__ import print_function import os.path from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build # If modifying these scopes, delete the file token.json. SCOPES = ['https://www.googleapis.com/auth/admin.directory.user'] USER_TOKEN = "token_create_user.json" CREDENTIALS = 'C:\Development\FreeLance\GoogleSamples\Credentials\Workspace-Installed-TestEverything.json' def main(): """Shows basic usage of the Admin SDK Directory API. Prints the emails and names of the first 10 users in the domain. """ creds = None # The file token.json stores the user's access and refresh tokens, and is # created automatically when the authorization flow completes for the first # time. if os.path.exists(USER_TOKEN): creds = Credentials.from_authorized_user_file(USER_TOKEN, SCOPES) # If there are no (valid) credentials available, let the user log in. if not creds or not creds.valid: if creds and creds.expired and creds.refresh_token: creds.refresh(Request()) else: flow = InstalledAppFlow.from_client_secrets_file( CREDENTIALS, SCOPES) creds = flow.run_local_server(port=0) # Save the credentials for the next run with open(USER_TOKEN, 'w') as token: token.write(creds.to_json()) service = build('admin', 'directory_v1', credentials=creds) # Call the Admin SDK Directory API print('Getting the first 10 users in the domain') results = service.users().list(customer='my_customer', maxResults=10, orderBy='email').execute() users = results.get('users', []) if not users: print('No users in the domain.') else: print('Users:') for user in users: print(u'{0} ({1})'.format(user['primaryEmail'], user['name']['fullName'])) if __name__ == '__main__': main()

回答 1 投票 0

如何使用 api 和 .Net 更改 google 群组成员的传送设置

如何使用 google api 更改 google 群组成员的传送设置? 在使用用户界面的 Google 群组中,我可以更改每个成员的传送设置: - 没有电子邮件 -

回答 3 投票 0

通过应用程序脚本为用户启用应用程序脚本API

尽管截至今天的文档有所说明,我还是设法通过服务帐户使用 Apps 脚本 API 我正在尝试找到一种方法,以编程方式为我的所有域启用 Apps 脚本 API

回答 1 投票 0

管理员 API 权限(暂停用户)

Google 管理控制台提供“暂停用户”API 权限。 暂停用户的 API 调用是什么? https://developers.google.com/admin-sdk/directory/v1/reference/users/patch 需要...

回答 3 投票 0

使用 postman 通过 google admin sdk/api 取消删除已删除的 google 工作空间用户

是否有人使用 undelete 命令在 Google Workspace 中使用 google admin SDK API 恢复已删除的用户? https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/undelete 我...

回答 1 投票 0

尝试访问目录 api 时无权访问此资源/api

我使用带有 googleapis 和 google-auth-library 包的节点来访问 G-Suite 域的用户。为此,创建了一个启用域范围委托的服务帐户:

回答 1 投票 0

如何配置 Google Workspace 提醒中心以向 PubSub 主题发布提醒?

我正在构建一个通知系统,当员工采取触发 DLP 规则的操作时,该系统将通知处于松弛状态的员工。 我想要达到的理想流程是: 员工采取行动 > 规则三...

回答 2 投票 0

G Suite Admin API 可访问所有用户的驱动器

我需要从管理员帐户访问所有 G Suite 用户帐户的 Google 云端硬盘帐户中的所有文件。 使用 Google Apps Admin SDKAPI,我可以访问所有帐户的信息,但无法访问

回答 2 投票 0

如何使用 Google Admin API 从用户帐户中删除管理员角色分配?

我需要从用户帐户列表中删除角色分配。我熟悉 Google Apps 脚本,但需要帮助制定使用 Google A 删除角色分配所需的脚本...

回答 1 投票 0

我正在尝试获取在“orgTitle”中设置了值的用户列表

我正在尝试获取在“orgTitle”中设置了值的用户列表。 我正在参考以下文档: https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list

回答 0 投票 0

如何在发送推送消息之前检查 firebase 令牌? [重复]

如何验证设备通过 api 调用发送到服务器的 firebase 令牌? 我想在发送推送消息之前检查令牌的有效性。 现在我们通过 POST 调用发送推送通知:https://fcm.

回答 0 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.