動的グループ用のメンバーシップ クエリを作成する

Google 管理コンソールで動的グループ用のメンバーシップ クエリを作成するには、デフォルトの標準属性、作成したカスタム属性、またはその両方を使用できます。

このページの内容

標準の属性を使用する

管理コンソールで動的グループを作成する場合は、[条件] リストから標準属性を選択します。次の表のすべての属性を使用して、動的グループ用のメンバーシップ クエリを作成できます。

属性

サンプルコード

addresses.country

user.addresses.exists(address, address.country == 'カナダ')

国コード

addresses.country_code

user.addresses.exists(address, address.country_code == '555')

カスタムの住所の種類

addresses.custom_type

user.addresses.exists(address, address.custom_type=='[カスタムの住所の種類]')

以降の住所

addresses.extended_address

user.addresses.exists(address, address.extended_address=='カリフォルニア州、アメリカ')

住所の地域

addresses.locality

user.addresses.exists(address, address.locality=='南カリフォルニア')

郵便番号

addresses.postal_code

user.addresses.exists(address, address.postal_code=='94040')

私書箱

addresses.po_box

user.addresses.exists(address, address.po_box=='87132')

メインの住所

addresses.primary

user.addresses.exists(address, address.primary==true)

リージョン

addresses.region

user.addresses.exists(address, address.region=='南西部')

番地

addresses.street_address

user.addresses.exists(address, address.street_address=='123 Fake St')

Address type(住所の種類)

addresses.type

user.addresses.exists(address, address.type==1)

メールアドレス

emails.address

user.emails.exists(email, email.address.startsWith(''))

カスタムメールタイプ

emails.custom_type

email.address.startsWith('custom@google.com')

メインのメールアドレスである

emails.primary

user.emails.exists(email, email.primary==true)

メールの種類

emails.type

user.emails.exists(email, email.type==1)

カスタムの外部 ID の種類

external_ids.custom_type

user.external_ids.exists(id, id.custom_type.startsWith('ランナー'))

外部 ID の種類

external_ids.type

user.external_ids.exists(id, id.type==3)

外部 ID

external_ids.value

user.external_ids.exists(id, id.value=='')

性別の代名詞

gender.address_me_as

user.gender.address_me_as=='彼ら'

カスタムの性別の種類

gender.custom_gender

user.gender.custom_gender.startsWith('[カスタムの性別]')

性別の種類

gender.type

user.gender.type==3

カスタム IMS プロトコル

ims.custom_protocol

user.ims.exists(im, im.custom_protocol.startsWith('[カスタム]'))

カスタム IMS タイプ

ims.custom_type

user.ims.exists(im, im.custom_type.startsWith('[カスタム]'))

標準の IMS プロトコル

ims.standard_protocol

user.ims.exists(im, im.standard_protocol==7)

メインの IMS である

ims.primary

user.ims.exists(im, im.primary==true)

IMS のタイプ

ims.type

user.ims.exists(im, im.type==3)

インスタント メッセンジャー

ims.value

user.ims.exists(im, im.value=='チャット')

カスタムのキーワードの種類

keywords.custom_type

user.keywords.exists(keyword, keyword.custom_type.startsWith('業務委託者'))

キーワード タイプ

keywords.type

user.keywords.exists(keyword, keyword.type==3)

キーワード

keywords.value

user.keywords.exists(keyword, keyword.value=='エンジニア')

言語コード

languages.language_code

user.languages.exists(language, language.language_code=='英語')

位置情報エリア

locations.area

user.locations.exists(loc, loc.area=='サンフランシスコ近郊')

建物 ID

locations.building_id

user.locations.exists(loc, loc.building_id=='')

カスタムの場所の種類

locations.custom_type

user.locations.exists(loc, loc.custom_type=='場所')

デスクコード

locations.desk_code

user.locations.exists(loc, loc.desk_code=='デスク 37')

フロア名

locations.floor_name

user.locations.exists(loc, loc.floor_name=='')

フロア セクション

locations.floor_section

user.locations.exists(loc, loc.floor_section=='')

ロケーション タイプ

locations.type

user.locations.exists(loc, loc.type==1)

name.family_name

user.name.family_name==''

name.given_name

user.name.given_name==''

名前

name.value

user.name.value==''

費用センター

organizations.cost_center

user.organizations.exists(org, org.cost_center=='')

カスタム組織タイプ

organizations.custom_type

user.organizations.exists(org, org.custom_type=='非営利団体')

部門

organizations.department

user.organizations.exists(org, org.department=='')

Employee Type

organizations.description

user.organizations.exists(org, org.description=='検索プロバイダ')

ドメイン

organizations.domain

user.organizations.exists(org, org.domain=='example.net')

組織の所在地

organizations.location

user.organizations.exists(org, org.location=='カリフォルニア')

組織名

organizations.name

user.organizations.exists(org, org.name=='Google')

メインの組織である

organizations.primary

user.organizations.exists(org, org.primary==true)

組織のシンボル

organizations.symbol

user.organizations.exists(org, org.symbol=='GOOG')

役職

organizations.title

user.organizations.exists(org, org.title=='')

組織の種類

organizations.type

user.organizations.exists(org, org.type==2)

カスタムの電話番号の種類

phones.custom_type

user.phones.exists(phone, phone.custom_type.startsWith('new type'))

メインの電話番号

phones.primary

user.phones.exists(phone, phone.primary==true)

スマートフォンの種類

phones.type

user.phones.exists(phone, phone.type==11)

電話番号

phones.value

user.phones.exists(phone, phone.value=='')

カスタムの関係の種類

relations.custom_type

user.relations.exists(rel, rel.custom_type=='例')

関係の値

relations.value

user.relations.exists(rel, rel.value=='Sundar')

関係タイプ

relations.type

user.relations.exists(rel, rel.type==12)

カスタムのウェブサイトの種類

websites.custom_type

user.websites.exists(site, site.custom_type.startsWith('creative writing'))

メインのウェブサイトである

websites.primary

user.websites.exists(site, site.primary==true)

ウェブサイトのタイプ

websites.type

user.websites.exists(site, site.type==2)

ウェブサイト

websites.value

user.websites.exists(site, site.value=='google.com')

祖先組織部門

org_units.org_unit_id

user.org_units.exists(org_unit, org_unit.org_unit_id==orgUnitId(''))

Manager's email(管理者のメールアドレス)

managers.user_id

user.managers.exists(manager, manager.user_id==userId(''))

アーカイブ済み

アーカイブ済み

user.archived==true

ログイン時のパスワード変更

change_password_at_next_login

user.change_password_at_next_login==true

2 段階認証プロセス適用済み

is_2sv_enforced

user.is_2sv_enforced==true

2 段階認証プロセスに登録済み

is_enrolled_in_2sv

user.is_enrolled_in_2sv==true

メールボックスが設定済みである

is_mailbox_setup

user.is_mailbox_setup==true

メインのメールアドレス

primary_email

user.primary_email==''

一時停止されている

強制停止

user.suspended==true

停止理由

suspension_reason

user.suspension_reason==4

親組織部門

org_unit_id

user.org_unit_id==orgUnitId('')

性別

Gender.Gender

user.custom_schemas.Gender.Gender.exists(G, G=='')

民族

Ethnicity.Ethnicity

user.custom_schemas.Ethnicity.Ethnicity.exists(E, E=='')

カスタム属性を使用する

管理コンソールでメンバーシップ クエリを作成すると、[条件] リストの標準の属性の後にカスタム属性が表示されます。

カスタム属性を含むクエリを実行し、クエリで返されたメンバーがゼロの場合は、Groups API で属性プロパティが正しく設定されていない可能性があります。具体的には、「indexed」プロパティを true に設定する必要があります。詳しくは、カスタム ユーザー属性をご覧ください。

ユーザーを動的グループに自動的に含める

ユーザーのアカウント情報を編集してクエリ条件と一致するようにすると、ユーザーが動的グループに自動的に追加されます。ユーザーのアカウントの詳細を編集するには、Directory API を使用します。詳しくは、ユーザー アカウントの更新をご覧ください。

管理コンソール(通常は [ユーザー] ページ)で、次のようなユーザー アカウントの詳細を編集することもできます。

2 段階認証プロセス適用済み 2 段階認証プロセス登録済み
アドレスの種類 祖先組織部門
ビルディング ID ログイン時のパスワード変更
コストセンター 部門
メールアドレス メールの種類
外部 ID
階の名前 階のセクション
アーカイブ済み メインのメールアドレスである
メールボックスが設定済みである チャンネルが一時停止中である
役職
マネージャーのユーザー ID 名前
親組織部門 電話番号
電話タイプ

動的グループからユーザーを除外する

条件を満たしていないユーザーのみを追加するには、動的グループの条件を作成して、除外アイコン をクリックします。たとえば、米国に居住していないユーザーのみのグループを作成するには、「国コードが US と等しい」という条件を指定して除外アイコン をクリックします。クエリでは、除外されたユーザーは感嘆符(!)で示されます。

「exists」パラメータを含む一部のカスタムクエリでは、除外オプションを使用できません。詳しくは、クエリの作成とテストをご覧ください。