---
title: Google Workspace を Directory Sync に接続する
description: Google 管理コンソールで Directory Sync を承認し、Google CDS ドメインを追加して、ユーザーとグループを OpenLM Version 26 に同期するように設定します。
product: OpenLM Version 26 (legacy)
---

> **OpenLM Version 26（レガシー）。** このページは OpenLM Platform ではなくレガシー製品について説明しています。

Google Workspace ディレクトリのユーザー、グループ、組織部門（OU）を OpenLM に取り込むには、ディレクトリを Directory Sync に接続します。Directory Sync の UI では、このディレクトリの種類は **Google CDS** です。

Directory Sync は、OpenLM が提供する Google サービスアカウントで接続します。Google 管理コンソールでそのアカウントに読み取り専用のアクセスを承認してから、Directory Sync でドメインと同期を追加します。

## はじめに

次の前提条件を確認します。

- Google Workspace ドメインの特権管理者アカウント。承認の手順で Google が要求します。
- OpenLM SLM に接続された Directory Synchronization Service (DSS) と、承認済みの Directory Synchronization Agent (DSA) が 1 つ以上。[Directory Sync設定](https://www.openlm.com/documentation/ja/legacy/directory-sync/configuration) を参照してください。

## Google Workspace で Directory Sync を承認する

Directory Sync がディレクトリを読み取れるようにするには、次の手順を実行します。

1. 特権管理者として Google 管理コンソールにサインインします。
2. **Security**、**Access and data control**、**API controls** の順に選択し、**Manage Domain Wide Delegation** を選択します。
3. **Add new** を選択します。
4. **Client ID** に `117731328853281683659` を入力します。
5. **OAuth scopes** に、次のカンマ区切りのスコープ一覧を入力します。

   ```text
   https://www.googleapis.com/auth/admin.directory.domain.readonly,https://www.googleapis.com/auth/admin.directory.orgunit.readonly,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
   ```

6. **Authorize** を選択します。

5 つのスコープは、ドメイン、組織部門、グループ、グループメンバー、ユーザーを対象とします。いずれも読み取り専用です。Directory Sync はディレクトリを参照できますが、変更はできません。

この画面についての Google の説明は、[Control API access with domain-wide delegation](https://support.google.com/a/answer/162106) を参照してください。

## Google CDS ドメインを追加する

ディレクトリをドメインとして追加するには、次の手順を実行します。

1. Directory Sync の UI で **Domain Manager** を開き、**Add Domain** を選択します。
2. **Directory type** で **Google CDS** を選択します。
3. フィールドに入力します。

   - **Domain name**: Google Workspace のドメイン。例: `example.com`。
   - **Client Id**: Google 管理コンソールで承認したクライアント ID。
   - **Username**: Directory Sync が接続に使用する Google Workspace 管理者アカウントのメールアドレス。

4. **Check domain connectivity** を選択し、テストを実行するエージェントを選択します。テストには最大 2 分かかります。
5. **Save** を選択します。このドメインの新しい同期定義にそのまま進むには、代わりに **Save Domain & Add Sync** を選択します。

## 同期を設定する

ドメインを同期するには、[新しい同期定義の追加](https://www.openlm.com/documentation/ja/legacy/directory-sync/configuration#新しい同期定義の追加) の説明に従って同期定義を追加します。Google CDS ドメインでは、次の設定が LDAP ディレクトリの場合と異なります。

| 設定 | Google CDS で入力する内容 |
| --- | --- |
| **Start Sync From** | 空のままにすると、すべての OU、グループ、ユーザーを同期します。1 つの OU から開始するには `ou=<ou_name>` を入力します。1 つのグループから開始するには `group=<group_name>` を入力します。例: `group=engineering@example.com`。入力できるのは 1 つの OU または 1 つのグループです。 |
| **Sync object type** | **Users**。Google CDS ドメインではコンピューターを同期しません。 |
| **Sync attribute** | `email`。 |
| **Membership filter** | **All objects**、**Only members of OUs**、**Only members of Security Groups** のいずれか。 |
| **Search depth** | 0。**Start Sync From** に OU またはグループを設定した場合を除きます。 |
| **Hierarchical** グループルール | Directory Sync は **Security groups** と **OU** からグループを作成します。配布グループとカスタムのオブジェクトクラスは使用できません。 |

どの Google の属性が各 OpenLM ユーザープロパティに入るかを変更するには、[Directory Sync のディレクトリ属性マッピング](https://www.openlm.com/documentation/ja/legacy/directory-sync/attribute-mappings) を参照してください。
