Tạo truy vấn tư cách thành viên cho nhóm động

Để tạo truy vấn tư cách thành viên cho nhóm động trong Bảng điều khiển dành cho quản trị viên của Google, bạn có thể sử dụng các thuộc tính tiêu chuẩn mặc định, thuộc tính tuỳ chỉnh mà bạn tạo hoặc cả hai.

Trên trang này

Sử dụng các thuộc tính chuẩn

Khi tạo một nhóm động trong Bảng điều khiển dành cho quản trị viên, bạn sẽ chọn các thuộc tính chuẩn trong danh sách Điều kiện. Bạn có thể sử dụng tất cả các thuộc tính trong bảng sau để tạo truy vấn tư cách thành viên cho nhóm động.

Thuộc tính

Mã mẫu

Quốc gia

addresses.country

user.addresses.exists(address, address.country == 'Canada')

Mã quốc gia

addresses.country_code

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

Loại địa chỉ tuỳ chỉnh

addresses.custom_type

user.addresses.exists(address, address.custom_type=='Custom address type')

Địa chỉ mở rộng

addresses.extended_address

user.addresses.exists(address, address.extended_address=='California, USA')

Địa chỉ thành phố

addresses.locality

user.addresses.exists(address, address.locality=='Southern California')

Zip/Mã bưu chính

addresses.postal_code

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

Hộp thư bưu điện

addresses.po_box

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

Là địa chỉ chính

addresses.primary

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

Khu vực

addresses.region

user.addresses.exists(address, address.region=='Southwest')

Địa chỉ đường phố

addresses.street_address

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

Loại địa chỉ

addresses.type

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

Địa chỉ email

emails.address

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

Loại email tuỳ chỉnh

emails.custom_type

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

Là email chính

emails.primary

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

Loại email

emails.type

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

Loại mã nhận dạng bên ngoài tuỳ chỉnh

external_ids.custom_type

user.external_ids.exists(id, id.custom_type.startsWith('runner'))

Loại mã nhận dạng bên ngoài

external_ids.type

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

Mã nhận dạng bên ngoài

external_ids.value

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

Đại từ chỉ giới tính

gender.address_me_as

user.gender.address_me_as=='they/them'

Loại giới tính tuỳ chỉnh

gender.custom_gender

user.gender.custom_gender.startsWith('custom gender')

Loại giới tính

gender.type

user.gender.type==3

Giao thức IMS tuỳ chỉnh

ims.custom_protocol

user.ims.exists(im, im.custom_protocol.startsWith('custom'))

Loại IMS tuỳ chỉnh

ims.custom_type

user.ims.exists(im, im.custom_type.startsWith('custom'))

Giao thức IMS tiêu chuẩn

ims.standard_protocol

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

Là IMS chính

ims.primary

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

Loại IMS

ims.type

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

Trình nhắn tin tức thì

ims.value

user.ims.exists(im, im.value=='chat')

Loại từ khoá tuỳ chỉnh

keywords.custom_type

user.keywords.exists(keyword, keyword.custom_type.startsWith('contractor'))

Loại từ khoá

keywords.type

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

Từ khoá

keywords.value

user.keywords.exists(keyword, keyword.value=='engineer')

Mã ngôn ngữ

languages.language_code

user.languages.exists(language, language.language_code=='English')

Khu vực vị trí

locations.area

user.locations.exists(loc, loc.area=='Near San Francisco')

Mã toà nhà

locations.building_id

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

Loại vị trí tuỳ chỉnh

locations.custom_type

user.locations.exists(loc, loc.custom_type=='Region')

Mã không gian làm việc

locations.desk_code

user.locations.exists(loc, loc.desk_code=='Desk 37')

Tên sàn

locations.floor_name

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

Phần sàn

locations.floor_section

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

Loại vị trí

locations.type

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

Họ

name.family_name

user.name.family_name==''

Tên

name.given_name

user.name.given_name==''

Tên

name.value

user.name.value==''

Trung tâm chi phí

organizations.cost_center

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

Loại tổ chức tuỳ chỉnh

organizations.custom_type

user.organizations.exists(org, org.custom_type=='nonprofit')

Phòng ban

organizations.department

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

Loại nhân viên

organizations.description

user.organizations.exists(org, org.description=='search provider')

Miền

organizations.domain

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

Vị trí của tổ chức

organizations.location

user.organizations.exists(org, org.location=='California')

Tên tổ chức

organizations.name

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

Là tổ chức chính

organizations.primary

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

Ký hiệu của tổ chức

organizations.symbol

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

Chức danh

organizations.title

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

Loại tổ chức

organizations.type

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

Loại điện thoại tuỳ chỉnh

phones.custom_type

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

Là số điện thoại chính

phones.primary

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

Loại điện thoại

phones.type

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

Số điện thoại

phones.value

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

Loại mối quan hệ tuỳ chỉnh

relations.custom_type

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

Giá trị quan hệ

relations.value

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

Loại mối quan hệ

relations.type

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

Loại trang web tuỳ chỉnh

websites.custom_type

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

Là trang web chính

websites.primary

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

Loại trang web

websites.type

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

Trang web

websites.value

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

Đơn vị tổ chức cấp trên

org_units.org_unit_id

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

Email của người quản lý

managers.user_id

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

Đã lưu trữ

đã lưu trữ

user.archived==true

Thay đổi mật khẩu lúc đăng nhập

change_password_at_next_login

user.change_password_at_next_login==true

Đã thực thi xác minh 2 bước

is_2sv_enforced

user.is_2sv_enforced==true

Đã đăng ký quy trình xác minh 2 bước

is_enrolled_in_2sv

user.is_enrolled_in_2sv==true

Đã thiết lập hộp thư

is_mailbox_setup

user.is_mailbox_setup==true

Email chính

primary_email

user.primary_email==''

Bị tạm ngưng

tạm ngưng

user.suspended==true

Lý do tạm ngưng

suspension_reason

user.suspension_reason==4

Đơn vị tổ chức mẹ

org_unit_id

user.org_unit_id==orgUnitId('')

Giới tính

Gender.Gender

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

Sắc tộc

Ethnicity.Ethnicity

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

Sử dụng các thuộc tính tuỳ chỉnh

Khi bạn tạo một truy vấn tư cách thành viên trong Bảng điều khiển dành cho quản trị viên, các thuộc tính tuỳ chỉnh sẽ xuất hiện sau các thuộc tính chuẩn trong danh sách Điều kiện.

Nếu bạn chạy một truy vấn có chứa thuộc tính tùy chỉnh và truy vấn đó trả về 0 thành viên, thì các đặc tính của thuộc tính có thể được đặt không đúng trong API Groups. Cụ thể, bạn cần đặt đặc tính "indexed" thành "true". Để biết thông tin chi tiết, hãy xem bài viết Thuộc tính tuỳ chỉnh của người dùng.

Tự động thêm người dùng vào nhóm động

Bạn có thể chỉnh sửa thông tin tài khoản của người dùng sao cho thông tin đó khớp với các điều kiện của truy vấn để tự động thêm người dùng vào một nhóm động. Bạn có thể chỉnh sửa bất kỳ thông tin chi tiết nào trong tài khoản của người dùng bằng API Thư mục. Để biết thông tin chi tiết, hãy tham khảo phần Cập nhật tài khoản người dùng.

Bạn cũng có thể chỉnh sửa một số thông tin chi tiết về tài khoản người dùng trong Bảng điều khiển dành cho quản trị viên, thường là trên trang Người dùng, bao gồm:

Đã thực thi quy trình xác minh 2 bước Đã đăng ký quy trình xác minh 2 bước
Loại địa chỉ Đơn vị tổ chức cấp trên
Mã nhận dạng toà nhà Thay đổi mật khẩu lúc đăng nhập
Trung tâm chi phí Khu hành chính
Địa chỉ email Loại email
ID bên ngoài Tên
Tên tầng Phần tầng
Đã lưu trữ Là email chính
Đã thiết lập hộp thư Bị tạm ngưng
Chức danh Họ
ID người dùng của người quản lý Tên
Đơn vị tổ chức mẹ Số điện thoại
Loại điện thoại

Loại trừ người dùng khỏi nhóm động

Để chỉ thêm những người dùng không đáp ứng một điều kiện, hãy tạo một điều kiện cho nhóm động rồi nhấp vào biểu tượng Loại trừ . Ví dụ: để tạo một nhóm chỉ chứa những người dùng không sinh sống ở Hoa Kỳ, bạn tạo điều kiện "Mã quốc gia bằng Hoa Kỳ", rồi nhấp vào Loại trừ . Trong truy vấn, bạn sẽ thấy dấu chấm than (!) cho tiêu chí loại trừ.

Đối với một số truy vấn tuỳ chỉnh có tham số "exists", bạn không thể sử dụng chế độ loại trừ. Để biết thông tin chi tiết, hãy tham khảo phần Tạo và kiểm thử truy vấn.