OpenAI
此頁面由機器翻譯。查看原文英文文章

Google Workspace - 管理員管理設定

更新日期:13 days ago

要使用 admin-managed setup 將 Google Workspace 連接至 ChatGPT,你首先需要在 Google 的管理員主控台中設定存取權:

  • 建立服務帳戶,對 Google Drive、使用者及群組提供唯讀存取權。

    • 強烈建議在與你的 ChatGPT 工作區相關聯的同一個 Google 帳戶下建立此服務帳戶。若 ChatGPT 工作區中的帳戶所用電郵網域與 Google Workspace 所用的不同,你便需要遵循額外步驟,才能為使用者啟用此連接器。

  • 建立管理員帳戶,讓服務帳戶可代表該帳戶執行操作。

然後,在 ChatGPT 管理員主控台完成設定:

  • 上傳服務帳戶的私人金鑰(來自 Google 的 JSON 檔案)

  • 指定管理員帳戶(無需憑證)。

  • 選擇要同步的檔案,以及選擇可存取此連線的使用者。

本指南會逐步帶你完成這 6 個步驟。

設定服務帳戶

  1. 前往 console.cloud.google.com

  2. 按一下專案下拉選單。Image請確認你登入的是與 ChatGPT 工作區相關聯的同一個 Google workspace(如你的 ChatGPT 工作區沒有相關聯的 Google workspace,且兩者使用不同電郵,你便需要按照額外步驟操作,否則你的使用者可能無法使用 Google Drive 同步連接器)。

  3. 選擇 New Project

    Google Cloud Select a resource dialog with dolores-lab.com organization selected
  4. 輸入Project Name

    Google Cloud New Project form with organization dolores-lab.com selected and Create button available
  5. 建立專案

    Google Cloud New Project form with ChatGPT Google Connector entered under the dolores-lab.com organization
  6. 等待專案建立完成,然後按一下 Select Project

    Google Cloud notifications confirm creation of the ChatGPT Google Connector project for dolores-lab.com
  7. 按一下 APIs & Services

    Image
  8. 按一下 Library

    Image
  9. 現在我們會加入三個 API,使用搜尋框找出它們

    Google Cloud API Library page with the ChatGPT Google Connector project selected
  10. 搜尋並選擇 Google Drive API

    Google Cloud API Library search results for Google Drive API in the ChatGPT Google Connector project
  11. 按一下 Enable

    Google Cloud Console Google Drive API page with the Enable button for the ChatGPT Google Connector project
  12. 按一下 Library

    Google Drive API details page with the API enabled and Create Credentials available
  13. 搜尋 Google Drive Activity

    Google Cloud API Library open for the ChatGPT Google Connector project
  14. 選擇 Google Drive Activity API

    Google Cloud API Library search results for Google Drive Activity API
  15. 按一下 Enable

    Image
  16. 按一下 Library

    Google Cloud Console Drive Activity API details page with the API enabled and Create credentials available
  17. 搜尋 Admin SDK API

    Google Cloud API Library page for the ChatGPT Google Connector project
  18. 選擇 Admin SDK API

    Google Cloud API Library search results for Admin SDK API with Admin SDK API listed
  19. 按一下 Enable

    Google Cloud Admin SDK API page with the Enable button for the ChatGPT Google Connector project
  20. 按一下 Credentials

    Google Cloud Admin SDK API details page with the API enabled and Create credentials button available
  21. 按一下 Create Credentials

    Google Cloud APIs & Services Credentials page with Configure consent screen button
  22. 按一下 Service account

    Google Cloud Credentials page with Create credentials menu open for API key, OAuth client ID, or service account
  23. 為此服務帳戶提供你自選的名稱描述

    Google Cloud Create service account page with Service Accounts selected and service account details fields
  24. (可選)你可以指派角色,ChatGPT 不需要這樣做。

    Google Cloud Create service account page with optional IAM role step and Service account created confirmation
  25. (可選)你可以授予服務帳戶存取權限,ChatGPT 不需要這樣做。

    Google Cloud Create service account step 3 with Done button and Service account created confirmation
  26. 按一下 Done

    Create service account step 3 in Google Cloud with Done button and Service account created confirmation
  27. 按一下現已建立的服務帳戶

    Google Cloud Credentials page listing the newly created ChatGPT Google Connector service account
  28. 按一下 keys.

    Google Cloud IAM service account details for ChatGPT Google Connector, enabled after creation
  29. 按一下 Add Key

    Image
  30. 按一下 Create new key

    Google Cloud service account Keys tab with Add key menu open to create or upload a key
  31. 保留預設的 JSON 金鑰類型,然後按一下 Create
    如果你看到「Service account key creation is disabled」錯誤訊息,請按照這些步驟啟用建立功能。

    Create private key dialog for ChatGPT Google Connector with JSON key type selected
  32. 按一下 Close。金鑰現已下載到你的電腦,你稍後會將它上傳至 ChatGPT 管理員主控台。

    Google Cloud service account Keys tab with confirmation that a private key JSON file was saved to the computer
  33. 按一下 details

    Google Cloud service account Keys tab for ChatGPT Google Connector with Add Key button
  34. 記下Unique ID。這會在步驟 42 用到。

    Google Cloud service account details for ChatGPT Google Connector with status Enabled
  35. 展開 Advanced settings

    Google Cloud service account details for ChatGPT Google Connector with the account enabled
  36. 向下捲動並按一下 View Google Workspace Admin Console。Google Workspace 主控台會在新分頁中開啟。

    Image
  37. 按一下 Show more

    Google Workspace Admin console home page for dolores-lab.com
  38. 展開 Security 部分

    Image
  39. 展開 Access and data controls 部分

    Google Workspace Admin console home with Security section expanded in the left navigation
  40. 按一下 API controls 部分

    Google Workspace Admin console home with Security > Access and data control expanded in the sidebar
  41. 按一下 Manage Domain Wide Delegation

    Google Admin console API controls page under Security > Access and data control
  42. 按一下 Add new

    Google Admin Domain-wide Delegation page with API clients list and Add new option
  43. 使用先前記下的 Unique ID 作為此 Client ID 的值

    Google Admin Domain-wide Delegation dialog for adding a new client ID and OAuth scopes
  44. 至於 OAuth scopes,請參考以下以逗號分隔、你需要複製貼上的 auth scopes 值:

https://www.googleapis.com/auth/admin.directory.group.readonly, https://www.googleapis.com/auth/admin.directory.group.member.readonly, https://www.googleapis.com/auth/admin.directory.user.readonly, https://www.googleapis.com/auth/admin.directory.user.alias.readonly, https://www.googleapis.com/auth/drive.activity.readonly, https://www.googleapis.com/auth/drive.metadata.readonly, https://www.googleapis.com/auth/drive.readonly, https://www.googleapis.com/auth/userinfo.profile, https://www.googleapis.com/auth/userinfo.email
Scope推理
admin.directory.group.readonly執行以群組為基礎的權限控制
admin.directory.group.member.readonly執行以群組為基礎的權限控制
admin.directory.user.alias.readonly處理使用者透過別名獲授權限的情況
drive.activity.readonly在檔案發生變更時收到通知
drive.metadata.readonly同步檔案內容及相關中繼資料(例如最後修改日期)
drive.readonly同步檔案內容及相關中繼資料(例如最後修改日期)
userinfo.profile識別我們正為哪些使用者同步檔案
userinfo.email識別我們正為哪些使用者同步檔案
Google Admin Domain-wide Delegation dialog for adding a new client ID and OAuth scopes

45. 按一下 Authorize

Image

46. 成功!

Image

設定管理員帳戶

  1. 展開 Directory

    Google Admin Domain-wide Delegation page with a ChatGPT API client and scopes listed
  2. 按一下 Users

    Google Admin domain-wide delegation page listing a ChatGPT Google Connector API client and scopes
    Google Admin console Users page listing workspace accounts for setup and management
  3. 輸入你選擇的名字姓氏主要電郵地址

    Google Admin console Add new user form for creating a Workspace user at dolores-lab.com
  4. 按一下 Add new user

    Google Admin console Add new user form filled for a ChatGPT Connector account
  5. (可選)記下這些憑證。ChatGPT 不需要這些憑證。

    Google Admin Console New user added page for ChatGPT Connector with Copy Password and Done actions
  6. 按一下 Done

    Google Admin console Copy password dialog for a newly created user account
  7. 按一下你剛建立的帳戶。如果它沒有顯示在清單中,請重新整理頁面,或清除快取與 Cookie 後再試一次。

    Google Admin console Users page listing accounts including ChatGPT Connector
  8. 按一下 assign roles

    Google Admin user details page for the ChatGPT Connector service account
  9. 開啟 Groups Reader、User Management AdminStorage Admin 角色。

    Google Admin ChatGPT Connector user page with Admin roles and privileges open and no roles assigned
  10. 向下捲動並按一下 Save. 管理員帳戶現已成功建立並完成設定。

Image

在 ChatGPT 管理員主控台完成設定

  1. 前往 ChatGPT,然後按一下頁面右上角的個人資料圖示。

    Image
  2. 按一下 Manage workspace

    ChatGPT workspace menu with Manage workspace selected under the organization switcher
  3. 按一下 Connections ,然後在 「Synced connectors」 之下 → Enable Sync

    Connectors page with Google Drive sync prompt and Enable Sync button highlighted
  4. 確認已選取 Admin-managed,然後按一下 Next

    Google Drive connection setup with Admin-managed setup selected over Self-service setup
  5. 輸入顯示名稱。建議使用你的 Google Workspace 名稱。請注意,我們目前不支援變更你的連線名稱。

    Google Workspace connector setup dialog with display name Dolores Labs entered
  6. 按一下 Save Draft and Continue

  7. 按一下 Upload key。選擇 JSON 檔案,即你在上方設定服務帳戶時下載的金鑰。請確認此金鑰正確無誤

    Google Workspace connection setup step prompting upload of a service account key and admin email address
  8. 輸入管理員電郵地址。這是你先前建立的管理員帳戶。

    Image
  9. 按一下 Save.

    ChatGPT Connections credentials dialog with service account key and Google Workspace admin email entered
  10. 選擇是否要包含所有使用者的 My Drives 內的檔案。

    ChatGPT Connections modal for User files with Include user My Drives enabled at step 2 of 5
  11. 按一下 Next

    ChatGPT admin Connections modal for User files with Include user My Drives enabled in step 2 of 5
  12. 選擇如何管理共用雲端硬碟。我們支援以下三種情況:

    1. 如果你想包含所有共用雲端硬碟,請選擇 Include by default ,並且不要加入要排除的共用雲端硬碟 ID

    2. 如果你想包含大部分共用雲端硬碟,請選擇 Include by default,並加入你想排除的共用雲端硬碟 ID

    3. 如果你想排除大部分共用雲端硬碟,請選擇 Exclude by default,並加入你想包含的共用雲端硬碟 ID

    ChatGPT admin Shared drives setup with Include by default selected and an Excluded Shared drives field
  13. 如要查找共用雲端硬碟的 ID,請在網頁瀏覽器中前往該雲端硬碟。URL 的最後部分就是共用雲端硬碟 ID。
    在以下例子中,它是 `0ADvY03uUbEcQUk9PVA`'

    Google Drive shared drive with Manage members visible for Example Shared Drive
  14. 按一下 Next

    ChatGPT admin Connections modal for Shared drives with Include by default selected at step 3 of 5
  15. 選擇哪些人應可存取 Google Drive 連線。你可以只選擇 ChatGPT 工作區管理員,或對所有人啟用。若對所有人啟用,之後新增至工作區的新使用者亦會自動包括在內。

    Google Drive connector permission set to Admins only for workspace members
  16. 按一下 Start syncing

    Image
  17. 你的 Google Drive 連線現已成功建立!
    請注意,雖然系統會立即開始同步,但視乎根據你的設定包含了多少檔案,完成同步可能需時數小時至數日。
    當過去 30 日內新增/編輯的檔案完成同步後,已為其啟用此連接器的使用者便可使用它。

    Image

啟用服務帳戶金鑰建立

如果你收到以下錯誤,便需要為這個特定專案啟用服務帳戶建立:

> 貴機構已強制執行組織政策限制「iam.disableServiceAccountKeyCreation」。

Google Cloud service account Keys tab with error that service account key creation is disabled
  1. 開啟新分頁並前往 console.cloud.google.com。請確認所選專案是你先前已選取的那個。
    按一下左上角的選單圖示

    Google Cloud Console welcome page for the ChatGPT Google Connector project
  2. 將滑鼠移至 IAM & Admin

    Google Cloud Console navigation with IAM & Admin open and Organization Policies selected
  3. 按一下 Organizational Policies

    Google Cloud Console IAM & Admin menu opened to Organization Policies
  4. 搜尋 iam.disableServiceAccountKeyCreation

    Google Cloud organization policies for the ChatGPT Google Connector project
  5. 按一下 constraints/iam.disableServiceAccountKeyCreation
    的結果

    Image
  6. 在 ID 為 iam.disableServiceAccountKeyCreation
    的列中,按一下 …

    Organization policies filtered to Disable service account key creation for the ChatGPT Google Connector project
  7. 按一下 Edit policy。如果 Edit policy 已停用,你需要成為 Organization Policy Administrator。

    Google Cloud Organization Policies filtered to Disable service account key creation with Edit policy menu open
  8. 按一下 Override parent’s policy

    Image
  9. 按一下 Add a rule

    Edit policy page for Disable service account key creation with Override parent's policy selected
  10. 按一下 Set Policy

    Google Cloud Edit policy page with Override parent's policy selected and enforcement set to Off
  11. 你現在可以建立服務帳戶金鑰。此啟用設定可能需要數分鐘才會生效。

Google Cloud policy details with Disable service account key creation set to Not enforced

成為 Organization Policy Administrator

  1. 前往 console.cloud.google.com,然後按一下專案/機構選擇器

    Google Cloud welcome page for the ChatGPT Google Connector project
  2. 按一下你的機構

    Image
  3. 按一下左上角的選單圖示

    Image
  4. 將滑鼠移至 IAM & Admin

    Google Cloud console navigation menu open with Google Cloud Setup pinned
  5. 按一下 IAM

    Image
  6. 按一下你帳戶旁的鉛筆

    Google Cloud IAM page for dolores-lab.com showing organization permissions and the Grant Access action
  7. 按一下 Add Another Role

    Google Cloud IAM dialog assigning the Organization Administrator role for dolores-lab.com
  8. 搜尋 Organization Policy Administrator

    Google Cloud IAM edit access dialog assigning the Organization Administrator role to a user
  9. 按一下 Organization Policy Administrator

    Google Cloud IAM role picker with Organization Policy Administrator selected while editing access
  10. 按一下 Save

    Google Cloud IAM access editor assigning Organization Administrator and Organization Policy Administrator roles
  11. 你的帳戶現已具備啟用服務帳戶金鑰建立的權限。此設定可能需要數分鐘才會生效。

使用 Google 電郵別名,讓 Google Workspace 與 ChatGPT 保持不同電郵帳戶

如果你是管理員,正使用 Google Drive 同步連接器的admin-managed setup,將 Google Workspace 連接至你的 ChatGPT 工作區,而你的機構為 ChatGPT 與 Google Workspace 使用不同電郵網域,你便需要執行額外步驟,以確保使用者可成功存取 Google Drive 同步連接器。

建議:如情況許可,Google Workspace 和 ChatGPT 帳戶請使用相同的主要電郵地址。

如果這樣不可行,請按照以下指示設定與 ChatGPT 登入電郵相符的 Google Workspace 電郵別名。

新增 Google Workspace 別名的步驟

請在 Google Admin Console 按以下步驟操作,以確保每位使用者的 ChatGPT 電郵都可連結至其 Google Workspace 帳戶:

  1. 前往 Admin Console。 依次前往:Directory > Users

Image

2. 選擇一位使用者,然後按「ADD ALTERNATIVE EMAILS」。

Google Admin user details page with Add alternate emails action highlighted

3. 新增備用電郵。請確認它對應使用者的 ChatGPT 帳戶。

Google Workspace Admin alternate email alias form with alias-testing-alt-email on bytesheaven.com

4. 選擇 Save


已知限制

不支援個人電郵地址

以個人地址(例如 example@gmail.com)註冊 ChatGPT 的使用者無法連接至 Google Workspace。此設定不受支援,而且存在安全風險,因為它容許從機構外部存取內部資料。

不支援 Gmail「+」別名

Gmail 允許使用者在地址後加上「+」來建立別名(例如 user+alias@gmail.com)。這類別名不適用於 Google Drive 同步連接器。該別名必須在 Google Workspace 中明確設定。

常見錯誤訊息

如果電郵地址未有正確連結,使用者可能會看到此訊息:「我們無法將你的帳戶連接至 Google Drive。按一下以了解更多。」

如果使用者收到此訊息,請檢查本文件中的步驟並確認已正確跟從。如需更多協助,請聯絡我們的支援團隊

這篇文章對你有幫助嗎?