GoSpace Manager

Version v0.11.0

Manage Google Workspace resources using a developer-friendly CLI written in Go

batch

Batch updates users using a CSV file as input

Synopsis

Implements the API documented at https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/update

gsm users update batch [flags]

Options

      --addresses int                    Specifies addresses for the user. May be used multiple times in the form of:
                                         '--addresses "country=...;countryCode=..;customType=..."', etc.
                                         You can use the following properties:
                                         country             - Country.
                                         countryCode         - The country code. Uses the ISO 3166-1 standard.
                                         customType          - If the address type is custom, this property contains the custom value.
                                         extendedAddress     - For extended addresses, such as an address that includes a sub-region.
                                         formatted           - A full and unstructured postal address. This is not synced with the structured address fields.
                                         locality            - The town or city of the address.
                                         poBox               - The post office box, if present.
                                         postalCode          - The ZIP or postal code, if applicable.
                                         primary             - BOOL! If this is the user's primary address. The addresses list may contain only one primary address.
                                         region              - The abbreviated province or state.
                                         sourceIsStructured  - BOOL! Indicates if the user-supplied address was formatted. Formatted addresses are not currently supported.
                                         streetAddress       - The street address, such as 1600 Amphitheatre Parkway. Whitespace within the string is ignored; however, newlines are significant.
                                         type                - The address type.
                                                               Acceptable values are:
                                                                 - "custom"
                                                                 - "home"
                                                                 - "other"
                                                                 - "work"
      --addresses_ALL strings            Same as addresses but value is applied to all lines in the CSV file
      --archived int                     Indicates if user is archived.
      --archived_ALL                     Same as archived but value is applied to all lines in the CSV file
      --batchThreads int                 Specify the number of threads that should be used for batch commands (overrides value in config file. Max 16)
      --changePasswordAtNextLogin int    Indicates if the user is forced to change their password at next login.
                                         This setting doesn't apply when the user signs in via a third-party identity provider.
      --changePasswordAtNextLogin_ALL    Same as changePasswordAtNextLogin but value is applied to all lines in the CSV file
      --customGender int                 Custom gender.
      --customGender_ALL string          Same as customGender but value is applied to all lines in the CSV file
      --delimiter string                 Delimiter to use for CSV columns. Must be exactly one character. Default is ';'
      --emails int                       Specifies email addresses for the user. May be used multiple times in the form of:
                                         '--emails "address=...;customType=..;primary=..."', etc.
                                         You can use the following properties:
                                         address     - Country.
                                         customType  - The country code. Uses the ISO 3166-1 standard.
                                         primary     - If the address type is custom, this property contains the custom value.
                                         type        - The type of the email account.
                                                       Acceptable values are:
                                                         - "custom"
                                                         - "home"
                                                         - "other"
                                                         - "work"
      --emails_ALL strings               Same as emails but value is applied to all lines in the CSV file
      --externalIds int                  Specifies externalIds for the user. May be used multiple times in the form of:
                                         '--externalIds "customType=...;type=..;value=..."'
                                         You can use the following properties:
                                         customType  - Country.
                                         type        - The type of the ID.
                                                       Acceptable values are:
                                                         - "account"
                                                         - "custom"
                                                         - "customer"
                                                         - "login_id"
                                                         - "network"
                                                         - "organization": IDs of this type map to employee ID in the Admin Console
                                         value       - The value of the ID.
      --externalIds_ALL strings          Same as externalIds but value is applied to all lines in the CSV file
      --familyName int                   The user's last name. Required when creating a user account.
      --familyName_ALL string            Same as familyName but value is applied to all lines in the CSV file
      --fields int                       Fields allows partial responses to be retrieved.
                                         See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
      --fields_ALL string                Same as fields but value is applied to all lines in the CSV file
      --genderType int                   Gender.
                                         Acceptable values are:
                                         female
                                         male
                                         other
                                         unknown
      --genderType_ALL string            Same as genderType but value is applied to all lines in the CSV file
      --givenName int                    The user's first name. Required when creating a user account.
      --givenName_ALL string             Same as givenName but value is applied to all lines in the CSV file
      --hashFunction int                 Stores the hash format of the password property.
                                         We recommend sending the password property value as a base 16 bit hexadecimal-encoded hash value.
                                         Set the hashFunction values as either the SHA-1, MD5, or crypt hash format.
      --hashFunction_ALL string          Same as hashFunction but value is applied to all lines in the CSV file
  -h, --help                             help for batch
      --ims int                          The user's Instant Messenger (IM) accounts.
                                         A user account can have multiple ims properties.
                                         But, only one of these ims properties can be the primary IM contact.
                                         The maximum allowed data size for this field is 2Kb.
                                         May be used multiple times in the form of:
                                         '--ims "customProtocol=...;customType=..;im=..."', etc.
                                         You can use the following properties:
                                         customProtocol  - If the protocol value is custom_protocol, this property holds the custom protocol's string.
                                         customType      - If the IM type is custom, this property holds the custom type string.
                                         im              - The user's IM network ID.
                                         primary         - BOOL! If this is the user's primary IM. Only one entry in the IM list can have a value of true.
                                         protocol        - An IM protocol identifies the IM network. The value can be a custom network or the standard network.
                                                           Acceptable values are:
                                                             - "aim": AOL Instant Messenger protocol
                                                             - "custom_protocol": A custom IM network protocol
                                                             - "gtalk": Google Talk protocol
                                                             - "icq": ICQ protocol
                                                             - "jabber": Jabber protocol
                                                             - "msn": MSN Messenger protocol
                                                             - "net_meeting": Net Meeting protocol
                                                             - "qq": QQ protocol
                                                             - "skype": Skype protocol
                                                             - "yahoo": Yahoo Messenger protocol
                                         type            - The type of the IM account.
                                                           Acceptable values are:
                                                            - "custom"
                                                            - "home"
                                                            - "other"
                                                            - "work"
      --ims_ALL strings                  Same as ims but value is applied to all lines in the CSV file
      --includeInGlobalAddressList int   Indicates if the user's profile is visible in the Workspace global address list when the contact sharing feature is enabled for the domain.
                                         For more information about excluding user profiles, see the administration help center.
      --includeInGlobalAddressList_ALL   Same as includeInGlobalAddressList but value is applied to all lines in the CSV file
      --ipWhitelisted int                If true, the user's IP address is white listed.
      --ipWhitelisted_ALL                Same as ipWhitelisted but value is applied to all lines in the CSV file
      --keywords int                     The user's keywords. The maximum allowed data size for this field is 1Kb.
                                         May be used multiple times in the form of:
                                         '--keywords "customType=...;type=..;value=..."'
                                         You can use the following properties:
                                         customType  - Custom Type.
                                         type        - Each entry can have a type which indicates standard type of that entry.
                                                       For example, keyword could be of type occupation or outlook.
                                                       In addition to the standard type, an entry can have a custom type and can give it any name.
                                                       Such types should have the CUSTOM value as type and also have a customType value.
                                                       Acceptable values are:
                                                         - "custom"
                                                         - "mission"
                                                         - "occupation"
                                                         - "outlook"
                                         value  -      Keyword.
      --keywords_ALL strings             Same as keywords but value is applied to all lines in the CSV file
      --languages int                    The user's languages. The maximum allowed data size for this field is 1Kb.
                                         May be used multiple times in the form of:
                                         '--languages "customLanguage=...;preference=..."'
                                         '--languages "languageCode=...;preference=..."'
                                         You can use the following properties:
                                         customLanguage  - Other language.
                                                           A user can provide their own language name if there is no corresponding Google III language code.
                                                           If this is set, LanguageCode can't be set
                                         languageCode    - Language Code.
                                                           Should be used for storing Google III LanguageCode string representation for language.
                                                           Illegal values cause SchemaException.
                                         preference      - Optional.
                                                           If present, controls whether the specified languageCode is the user's preferred language.
                                                           If customLanguage is set, this can't be set.
                                                           Allowed values are:
                                                             - preferred
                                                             - not_preferred
      --languages_ALL strings            Same as languages but value is applied to all lines in the CSV file
      --locations int                    The user's locations. The maximum allowed data size for this field is 10Kb.
                                         May be used multiple times in the form of:
                                         '--locations "area=...;buildingId=...;customType=..."', etc.
                                         You can use the following properties:
                                         area          - Textual location.
                                                         This is most useful for display purposes to concisely describe the location.
                                                         For example, "Mountain View, CA", "Near Seattle".
                                         buildingId    - Building identifier.
                                         customType    - If the location type is custom, this property contains the custom value.
                                         deskCode      - Most specific textual code of individual desk location.
                                         floorName     - Floor name/number.
                                         floorSection  - Floor section. More specific location within the floor.
                                                           For example, if a floor is divided into sections "A", "B", and "C", this field would identify one of those values.
                                         type          - The location type.
                                                         Acceptable values are:
                                                           - "custom"
                                                           - "default"
                                                           - "desk"
      --locations_ALL strings            Same as locations but value is applied to all lines in the CSV file
      --notesContentType int             Content type of note, either plain text or HTML.
                                         Default is plain text. Possible values are:
                                         text_plain
                                         text_html
      --notesContentType_ALL string      Same as notesContentType but value is applied to all lines in the CSV file
      --notesValue int                   Contents of notes.
      --notesValue_ALL string            Same as notesValue but value is applied to all lines in the CSV file
      --orgUnitPath int                  The full path of the parent organization associated with the user.
                                         If the parent organization is the top-level, it is represented as a forward slash (/).
      --orgUnitPath_ALL string           Same as orgUnitPath but value is applied to all lines in the CSV file
      --organizations int                A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.
                                         May be used multiple times in the form of:
                                         '--organizations "costCenter=...;customType=...;department=..."', etc.
                                         You can use the following properties:
                                         costCenter          - The cost center of the user's organization.
                                         customType          - If the value of type is custom, this property contains the custom type.
                                         department          - Specifies the department within the organization, such as 'sales' or 'engineering'.
                                         description         - The description of the organization.
                                         domain              - The domain the organization belongs to.
                                         fullTimeEquivalent  - INT! The full-time equivalent millipercent within the organization (100000 = 100%).
                                         location            - The physical location of the organization.
                                                               This does not need to be a fully qualified address.
                                         name                - The name of the organization.
                                         primary             - BOOL! Indicates if this is the user's primary organization.
                                                               A user may only have one primary organization.
                                         symbol              - Text string symbol of the organization.
                                                               For example, the text symbol for Google is GOOG.
                                         title               - The user's title within the organization, for example 'member' or 'engineer'.
                                         type                - The type of organization.
                                                               Acceptable values are:
                                                                 - "domain_only"
                                                                 - "school"
                                                                 - "unknown"
                                                                 - "work"
      --organizations_ALL strings        Same as organizations but value is applied to all lines in the CSV file
      --password int                     Stores the password for the user account.
                                         The user's password value is required when creating a user account.
                                         It is optional when updating a user and should only be provided if the user is updating their account password.
                                         A password can contain any combination of ASCII characters.
                                         A minimum of 8 characters is required. The maximum length is 100 characters.
                                         We recommend sending the password property value as a base 16 bit, hexadecimal-encoded hash value.
                                         If a hashFunction is specified, the password must be a valid hash key.
                                         The password value is never returned in the API's response body.
      --password_ALL string              Same as password but value is applied to all lines in the CSV file
      --path string                      Path of the import file (CSV)
      --phones int                       A list of the user's phone numbers. The maximum allowed data size for this field is 1Kb.
                                         May be used multiple times in the form of:
                                         '--phones "customType=...;primary=...;type=..."', etc.
                                         You can use the following properties:
                                         customType  - If the value of type is custom, this property contains the custom type.
                                         primary     - BOOL! Indicates if this is the user's primary phone number.
                                                       A user may only have one primary phone number.
                                         type        - The type of phone number.
                                                       Acceptable values are:
                                                         - "assistant"
                                                         - "callback"
                                                         - "car"
                                                         - "company_main"
                                                         - "custom"
                                                         - "grand_central"
                                                         - "home"
                                                         - "home_fax"
                                                         - "isdn"
                                                         - "main"
                                                         - "mobile"
                                                         - "other"
                                                         - "other_fax"
                                                         - "pager"
                                                         - "radio"
                                                         - "telex"
                                                         - "tty_tdd"
                                                         - "work"
                                                         - "work_fax"
                                                         - "work_mobile"
                                                         - "work_pager"
                                         value       - A human-readable phone number.
                                                       It may be in any telephone number format.
      --phones_ALL strings               Same as phones but value is applied to all lines in the CSV file
      --posixAccounts int                A list of POSIX account information for the user.
                                         May be used multiple times in the form of:
                                         '--posixAccounts "accountId=...;gecos=...;gid=..."', etc.
                                         You can use the following properties:
                                         accountId            - A POSIX account field identifier.
                                         gecos                - The GECOS (user information) for this account.
                                         gid                  - The default group ID.
                                         homeDirectory        - The path to the home directory for this account.
                                         operatingSystemType  - The operating system type for this account.
                                                                Acceptable values are:
                                                                  - "linux"
                                                                  - "unspecified"
                                                                  - "windows"
                                         primary              - BOOL! If this is user's primary account within the SystemId.
                                         shell                - The path to the login shell for this account.
                                         systemId             - System identifier for which account Username or Uid apply to.
                                         uid                  - The POSIX compliant user ID.
                                         username             - The username of the account.
      --posixAccounts_ALL strings        Same as posixAccounts but value is applied to all lines in the CSV file
      --primaryEmail int                 The user's primary email address.
                                         This property is required in a request to create a user account.
                                         The primaryEmail must be unique and cannot be an alias of another user.
      --recoveryEmail int                Recovery email of the user.
      --recoveryEmail_ALL string         Same as recoveryEmail but value is applied to all lines in the CSV file
      --recoveryPhone int                Recovery phone of the user.
                                         The phone number must be in the E.164 format, starting with the plus sign (+).
                                         Example: +16506661212.
      --recoveryPhone_ALL string         Same as recoveryPhone but value is applied to all lines in the CSV file
      --relations int                    A list of the user's relationships to other users.
                                         The maximum allowed data size for this field is 2Kb.
                                         May be used multiple times in the form of:
                                         '--relations "customType=...;type=...;value=..."'
                                         You can use the following properties:
                                         customType  - If the value of type is custom, this property contains the custom type.
                                         type        - The type of relation.
                                                       Acceptable values are:
                                                       - "admin_assistant"
                                                       - "assistant"
                                                       - "brother"
                                                       - "child"
                                                       - "custom"
                                                       - "domestic_partner"
                                                       - "dotted_line_manager"
                                                       - "exec_assistant"
                                                       - "father"
                                                       - "friend"
                                                       - "manager"
                                                       - "mother"
                                                       - "parent"
                                                       - "partner"
                                                       - "referred_by"
                                                       - "relative"
                                                       - "sister"
                                                       - "spouse"
                                         value       - The name of the person the user is related to.
      --relations_ALL strings            Same as relations but value is applied to all lines in the CSV file
      --skipHeader                       Whether to skip the first row (header)
      --sshPublicKeys int                A list of SSH public keys.
                                         May be used multiple times in the form of:
                                         '--sshPublicKeys "expirationTimeUsec=...;key=..."'
                                         You can use the following properties:
                                         expirationTimeUsec  - An expiration time in microseconds since epoch.
                                         key                 - An SSH public key.
      --sshPublicKeys_ALL strings        Same as sshPublicKeys but value is applied to all lines in the CSV file
      --suspended int                    Indicates if user is suspended.
      --suspended_ALL                    Same as suspended but value is applied to all lines in the CSV file
      --userKey int                      Identifies the user in the API request.
                                         The value can be the user's primary email address, alias email address, or unique user ID.
      --websites int                     The user's websites.
                                         The maximum allowed data size for this field is 2Kb.
                                         May be used multiple times in the form of:
                                         '--websites "customType=...;primary=...;type=..."', etc.
                                         You can use the following properties:
                                         customType  - The custom type. Only used if the type is custom.
                                         primary     - BOOL! If this is user's primary website or not.
                                         type        - The type or purpose of the website.
                                                       For example, a website could be labeled as home or blog.
                                                       Alternatively, an entry can have a custom type.
                                                       Custom types must have a customType value.
                                                       Acceptable values are:
                                                         - "app_install_page"
                                                         - "blog"
                                                         - "custom"
                                                         - "ftp"
                                                         - "home"
                                                         - "home_page"
                                                         - "other"
                                                         - "profile"
                                                         - "reservations"
                                                         - "resume"
                                                         - "work"
                                         value       - The URL of the website.
      --websites_ALL strings             Same as websites but value is applied to all lines in the CSV file

Options inherited from parent commands

      --compressOutput         By default, GSM outputs "pretty" (indented) objects. By setting this flag, GSM's output will be compressed. This may or may not improve performance in scripts.
      --config string          config file (default is $HOME/.config/gsm/.gsm.yaml)
      --delay int              This delay (plus a random jitter between 0 and 50) will be applied after every command to avoid reaching quota and rate limits. Set to 0 to disable.
      --dwdSubject string      Specify a subject used for DWD impersonation (overrides value in config file)
      --log string             Set the path of the log file. Default is either ~/gsm.log or defined in your config file
      --maxElapsedTime int     This is the maximum total time that will be spent retrying a request in minutes. (default 15)
      --maxRetryInterval int   This is the maximum interval that will be used between retry attempts in seconds. (default 320)
      --redirectPort int       This is the TCP port on which GSM will create web server if you authenticate with a user account for the first time. This is necessary for the OAuth flow. See https://developers.google.com/identity/protocols/oauth2/native-app#redirect-uri_loopback (default 8081)
      --retryOn ints           Specify the HTTP error code(s) that GSM should retry on. Note that GSM will always retry on HTTP 403 errors that indicate a quota / rate limit error
      --streamOutput           Setting this flag will cause GSM to output slice values to stdout one by one, instead of one large object

SEE ALSO