--- title: "userQuery (Command)" slug: "oas-fullsdk-soapref-userquery-command-3-29" updated: 2026-01-14T12:53:09Z published: 2026-01-14T17:11:21Z canonical: "docs.onespan.com/oas-fullsdk-soapref-userquery-command-3-29" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.onespan.com/llms.txt > Use this file to discover all available pages before exploring further. # userQuery (Command) The userQuery command allows querying user accounts that match specified search criteria. ## Parameters | Parameter name | Data type | Description | | --- | --- | --- | | sessionID | String | Required. The session identifier of the current administrative session. The logon command returns this identifier after a successful logon (see [logon (Command)](/sec/docs/oas-fullsdk-soapref-logon-command-3-29)). | | attributeSet | UserAttributeSet | Required. A set containing zero or more attribute fields that specify the query search criteria. See [UserAttributeSet (Data type)](/sec/docs/oas-fullsdk-soapref-userquery-command-3-29#userattributeset-data-type). | | fieldSet | UserFieldSet | Optional. Specifies the attribute fields to be returned for all the records matching the search criteria. See [UserFieldSet (Data type)](/sec/docs/oas-fullsdk-soapref-userquery-command-3-29#userfieldset-data-type). If fieldSet is omitted, all possible output parameters are returned. If a user attribute field is not set in the database, it is not returned for that specific user account. | | queryOptions | UserQueryOptions | Optional. Options to determine what results should be returned. See [UserQueryOptions (Data type)](/sec/docs/oas-fullsdk-soapref-userquery-command-3-29#userqueryoptions-data-type). | | Parameter name | Data type | Description | | --- | --- | --- | | results | UserQueryResults | Required. Result structure containing return and status codes and a list of zero or more result attribute fields. See [UserQueryResults (Data type)](/sec/docs/oas-fullsdk-soapref-userquery-command-3-29#userqueryresults-data-type). | ### UserAttributeSet (Data type) The attributes specified in this attribute set define the search criteria. Search attribute fields are interpreted as follows: - Wildcards are only accepted when the USERFLD_TO_USERID and USERFLD_TO_DOMAIN attributes are not set. - A wildcard character (*) can be added to the values at the start, the end, or both. They will be interpreted as the SQL LIKE statement. - A list of comma-separated values can be specified for the attribute that specifies the domain name. In this case it will be interpreted as the logical OR of the given values. You cannot use wildcard characters in comma-separated values. - If none of the above applies, the search will be done using the exact match of the given value. | Element name | Data type | Description | | --- | --- | --- | | attributes | UserAttribute | Attributes specifying the user query search criteria (see [Table: UserAttribute (Data type)](/sec/docs/oas-fullsdk-soapref-userquery-command-3-29#Tab_UserAttributeDataType)). | | Element name | Data type | Description | | --- | --- | --- | | attributeOptions | AttributeOptions | Specifies how to handle the attribute value during request processing, where each option is added as a single element to attributeOptions, e.g.: true Supported values: - negative. Indicates that the specified user attribute value should not be equal to the one specified. - null. Indicates that the specified attribute should be handled as zero-value. | | value | Any | The attribute value. The data type has to be specified by setting the xsi:type XML attribute. | | attributeID | UserAttributeIDEnum | The attribute identifier (see [Table: userQuery (Supported input attributes)](/sec/docs/oas-fullsdk-soapref-userquery-command-3-29#Tab_userQuerySupportedInputAttributes)). | | Attribute name | Optionality | | --- | --- | | USERFLD_ADMIN_PRIVILEGES | Optional | | USERFLD_ASSIGNED_DIGIPASS | Optional | | USERFLD_CREATE_TIME | Optional | | USERFLD_DESCRIPTION | Optional | | USERFLD_DISABLED | Optional | | USERFLD_DOMAIN | Optional | | USERFLD_EMAIL | Optional | | USERFLD_EXPIRED | Optional | | USERFLD_HAS_DP | Optional | | USERFLD_LAST_PASSWORD_SET_TIME | Optional | | USERFLD_LASTAUTH_TIME | Optional | | USERFLD_LOCKED | Optional | | USERFLD_MOBILE | Optional | | USERFLD_MODIFY_TIME | Optional | | USERFLD_ORGANIZATIONAL_UNIT | Optional | | USERFLD_PHONE | Optional | | USERFLD_SEARCH_DOWN_OU_PATH | Optional | | USERFLD_TO_DOMAIN | Optional | | USERFLD_TO_USERID | Optional | | USERFLD_USE_DP_FROM_USER_DOMAIN | Optional | | USERFLD_USE_DP_FROM_USER_ID | Optional | | USERFLD_USER_INACT_DAYS | Optional | | USERFLD_USERID | Optional | | USERFLD_USERNAME | Optional | For more information about the specific attributes, see [Table: userExecute field attributes](/sec/docs/oas-fullsdk-soapref-userexecute-command-3-29#Tab_userExecuteFieldAttributes). ### UserFieldSet (Data type) The attributes specified in the fieldSet parameter specify the user attribute fields OneSpan Authentication Server should return for the users accounts matching the search criteria. If fieldSet is omitted, all possible output parameters are returned. If an attribute field is not set in the database, it is not returned for that specific record. | Element name | Data type | Description | | --- | --- | --- | | attributeID | UserAttributeIDEnum | The identifier of an attribute to return (see [Table: userQuery (Supported output attributes)](/sec/docs/oas-fullsdk-soapref-userquery-command-3-29#Tab_userQuerySupportedOutputAttributes)). | | Attribute name | Returned? | | --- | --- | | USERFLD_ADMIN_PRIVILEGES | If defined | | USERFLD_ASSIGNED_DIGIPASS | If defined | | USERFLD_BACKEND_AUTH | If defined | | USERFLD_CREATE_TIME | If defined | | USERFLD_DESCRIPTION | If defined | | USERFLD_DISABLED | If defined | | USERFLD_DOMAIN | If defined | | USERFLD_EMAIL | If defined | | USERFLD_EXPIRED | If defined | | USERFLD_HAS_DP | If defined | | USERFLD_LAST_PASSWORD_SET_TIME | If defined | | USERFLD_LASTAUTH_TIME | If defined | | USERFLD_LASTAUTHREQ_TIME | If defined | | USERFLD_LOCAL_AUTH | If defined | | USERFLD_LOCKED | If defined | | USERFLD_MOBILE | If defined | | USERFLD_MODIFY_TIME | If defined | | USERFLD_OFFLINE_AUTH_ENABLED | If defined | | USERFLD_ORGANIZATIONAL_UNIT | If defined | | USERFLD_PHONE | If defined | | USERFLD_STATUS | If defined | | USERFLD_USE_DP_FROM_USER_DOMAIN | If defined | | USERFLD_USE_DP_FROM_USER_ID | If defined | | USERFLD_USER_INACT_DAYS | If defined | | USERFLD_USERID | If defined | | USERFLD_USERNAME | If defined | | USERFLD_VDP_DELIVERY_METHOD | If defined | | USERFLD_VDP_MDC_PROFILE | If defined | | USERFLD_VDP_SIGN_DELIVERY_METHOD | If defined | | USERFLD_VDP_SIGN_MDC_PROFILE | If defined | For more information about the specific attributes, see [Table: userExecute field attributes](/sec/docs/oas-fullsdk-soapref-userexecute-command-3-29#Tab_userExecuteFieldAttributes). ### UserQueryOptions (Data type) This data type determines what results should be returned. | Element name | Data type | Description | | --- | --- | --- | | count | Boolean | Flag to request OneSpan Authentication Server to return only the number of records in the result set, but not the result set itself. Default value: false | | distinct | Boolean | Flag to request OneSpan Authentication Server to return only unique query results. Default value: false | | rowcount | Unsigned Integer | Option to request OneSpan Authentication Server to return the specified number of result records, beginning with the record specified by rowoffset. If set to 0, all result records are returned. Default value: 0 | | rowoffset | Unsigned Integer | Option to request OneSpan Authentication Server to return result records starting from the specified offset. Can only be used together with rowcount. Default value: 0 | | sortfieldid | String | Optional. Required if you specify SortOrder. Determines the field attribute to use as sort key when sorting the result set using SortOrder. May contain any field attribute from the FieldSet parameter. | | sortorder | String | Optional. Determines the sort order of the result set. By default, the result set is unsorted. Possible values: - QUERYOPTIONSORTORDER_ASCENDING. Result set in ascending order. - QUERYOPTIONSORTORDER_DESCENDING. Result set in descending order. | ### UserQueryResults (Data type) | Element name | Data type | Description | | --- | --- | --- | | resultCodes | ResultCodes | Required. The result and status codes returned by the command. | | resultAttribute | UserAttributeList | Required. List containing the queried user attributes. Each item of type UserAttributeSet. | | resultCount | Integer | Required. The number of items in resultAttribute. | | errorStack | ErrorStack | Required. The error stack, indicating that the command has not completed successfully. | ## Example > Retrieve the user ID and domain of jane.doe: > > ```markup > > > > > > 3JSK8cmRjw4E30wAA=0nUTL-~3fmifTO > > > jane.doe > USERFLD_USERID > > >
> USERFLD_USERID > USERFLD_DOMAIN >
>
>
>
> ``` > Retrieve a list of all administrative user accounts (user ID and domain): > > ```markup > > > > > > 3JSK8cmRjw4E30wAA=0nUTL-~3fmifTO > > > > true > true > > 0 > USERFLD_ADMIN_PRIVILEGES > > >
> USERFLD_USERID > USERFLD_DOMAIN >
>
>
>
> ``` ## Requirements Required administrative privileges: - View Administrative Privileges (to use USERFLD_ADMIN_PRIVILEGES as input parameter) - View User ## Additional considerations After upgrading OneSpan Authentication Server, server data is continuously migrated while the already-upgraded OneSpan Authentication Server service is running. Until data migration has been completed, the result of a query command may be incomplete and may include both migrated and non-migrated data. This means that values for new data fields may be missing or not set correctly in the query result.