Change a GSPS configuration from the command line

Instead of using the configuration wizard, you can change the G Suite Password Sync (GSPS) configuration from the command line. 

When can I change the GSPS configuration from the command line? 

You can change the GSPS configuration from the command line if you are using:

  • GSPS version 1.6 or later.
  • A service account for Google authentication.
  • The GSPS application's security context to query your Microsoft® Active Directory®.

For other configuration options, see Set up G Suite Password Sync

Change a GSPS configuration from the command line

  1. Sign in to the domain controller as a domain administrator. The account you use must be from the domain controller’s domain.
  2. From a command prompt, navigate to the GSPS program folder. The default location is C:\Program Files\Google\G Suite Password Sync.
  3. Review the settings table below.
  4. Run GoogleAppsPasswordSync.exe specifying any settings that you want to update. Precede each argument with 2 dashes and enclose the parameters in quotation marks.

     

    Argument Purpose and parameter

    --admin_email

     

    Parameter: the email address of your Google administrator.

    Example: --admin_email="admin@myappsdomain.com"

    --apps_domain

    Parameter: your Google domain.

    Example: --apps_domain="myappsdomain.com"

    --base_dn

    Parameter: your Active Directory domain's base distinguished name (DN).

    This parameter is optional. When omitted, GSPS attempts to autodetect the base DN.

    Example: --base_dn="OU=users,DC=mydomain,DC=com"

    --credentials_file

    Parameter: the full path to your service account JSON file.

    Example: --credentials_file="c:\users\administrator\downloads\privatekey.json"

    --mail_attribute

    Parameter: the Active Directory attribute that contains each user's Google email address. This parameter is optional. When omitted, GSPS uses the default “mail” attribute.

    Example: --mail_attribute="Mail"

    --nouse_gui

    (required)

    Parameter: this argument has no parameters.
    --norestart_service

    Optional. When specified, GSPS skips the service restart after saving the configuration.

    Parameter: this argument has no parameters.

    --nowait_at_exit

    Optional. When specified, GSPS skips the "Press [ENTER] key to continue..." prompt at exit.

    Parameter: this argument has no parameters.

 

GSPS configuration example

​In the example, the Google domain is myappsdomain.com and the domain administrator is admin@myappsdomain.com. The service account's JSON file is located on the the domain controller at c:\users\administrator\downloads\privatekey.json. The Active Directory base DN is OU=users,DC=mydomain,DC=com and each user's Gmail address is stored in Active Directory's Mail attribute.

GoogleAppsPasswordSync.exe --nouse_gui --apps_domain="myappsdomain.com" --admin_email="admin@myappsdomain.com" --credentials_file="c:\users\administrator\downloads\privatekey.json" --base_dn="OU=users,DC=mydomain,DC=com" --mail_attribute="Mail"

Was this article helpful?
How can we improve it?