IT Pro: How to read users from Google Directory

Google Directory integration is managed under Preferences > Integration > Google Directory.

  • We integrate via Google API.
  • We have only read access to your Google Directory.
  • We have no access to any of your infrastructure information or passwords.
  • You make the connection.
  • Xink facilitates the integration via the Google API.
  • You decide which data to read (read-only, NOT write).
  • We only store the email signature data you chose (e.g. name, title, tel, etc.).

Link Google Account

Open the page and check the "Enable Google Directory integration" box.''
Then click the "Link Google Account" button and log into your Google Workspace using an admin account with at least [OU, Users, Groups > Read] permissions.

The next window will show the minimum view permissions required for this integration to work, and then click 'Allow'.

Then click Check Google connectivity to verify Xink connectivity to your Google directory.

Click Save to DONE!

Import sequence is started once in an hour. Actual import delay might differ depending on current service load. You may trigger an update under Dashboard> Schedule Update

How to apply a filter when importing Google directory users to Xink.

You use the query string without escaping the URL.

The query parameter is entered in the same way as described in the Examples section of the page:
https://developers.google.com/admin-sdk/directory/v1/guides/search-users

Default Filter Examples:

1. Import users with a givenName OR familyName that contains a value.

name='John' 

2. Import for users in a given country.

addressCountry='United Kingdom'

3. Import users with SMTP address that ends with @company.com

email:*@company.com

4. Import only the users in a specific organization.

orgName=Engineering 

5. Import only the users with the same direct manager.

directManager='[email protected]'  

6. Combination of the server-side and client-side filters.
Import users that are active and with an SMTP address that ends with @company.com

IsSuspended=false
$.mail != null && $.mail.indexOf('@company.com') > -1

7. Import all users in a specified Organizational Unit "/Denmark" and users in its sub-OU.

orgUnitPath=/Denmark

OR

orgUnitPath=/Denmark/Users/Standard


NOTE: Use '   ' if the target OU has space ex: OrgUnitPath='/United Kingdom' 

Client-side Filter

The client-side filter is used if you have a complex query that cannot be supported by the Google Directory API(Server-side filter).
The client-side filter can work in combination with Server-side filters.
The Javascript syntax is used in Client-Side filtering. Learn more about Java SYNTAX and OPERATORS
Only Google Directory attributes defined HERE can be used for your filter.

Examples below:

1. This filter will import only users with the specified @domain, for example, all users with @xink.io

$.mail != null && $.mail.indexOf('@xink.io') > -1


2. This filter will import only users with the last name.

$.sn != null && $.sn.length > 0


3. This filter will import all users with the specified email domains(domain1.com and domain2.com)

$.mail != null && ($.mail.indexOf('@domain1.com') > -1 || $.mail.indexOf('@domain2.com') > -1)


4. Import only users with a job title which is an easy way to filter out 'non-real' user

$.title != null && $.title.length > 0


5. Import users from the specified departments(Marketing or Support Team)

$.department == "Marketing" && $.department == "Support Team"



6. Import users from the specified company name

$.company == "Company Name" 


 7. 
Import all active users, Excluding the specified OrgUnitPath and Department.

IsSuspended=false
$.orgUnitPath != null && $.orgUnitPath.indexOf('/Denmark') == -1 && $.orgUnitPath.indexOf('/United Kingdom') == -1 && $.orgUnitPath.indexOf('/Australia') == -1 && $.department != "External"

8. Import all users within a specific Google Group. Please take note that nested groups are NOT supported.

$.groupCnList != null && $.groupCnList.indexOf('"Google Group Name"') != -1

For multiple groups:

$.groupCnList != null && $.groupCnList.indexOf('"Google Group Name"') != -1 || $.groupCnList != null && $.groupCnList.indexOf('"Google Group Name 2"') != -1

NOTE: In Client-Side filtering, check connectivity will not show the number of users that met the filter conditions but will be imported.

Learn more

IT Pro: Fields that are pulled from Google Directory by default.
How to map custom fields from Google Directory
IT Pro: How to read groups from Google Directory.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.
Quick 1-on-1 Demo | Ⓒ 2024 Xink