Service: zimbraAdmin

Command: SearchDirectory
Namespace: urn:zimbraAdmin
Description: Search directory
Access: domain admin sufficient (though a domain admin can't specify "domains" as a type)
Properties:
Authorization token required true
Admin Authorization token required true

SearchDirectoryRequest

    <SearchDirectoryRequest [query="..."] [maxResults="(Integer)"] [limit="(Integer)"] [offset="(Integer)"]
                               [domain="{domain-name}"] [applyCos="(0|1)"] [applyConfig="(0|1)"] [sortBy="{sort-by}"]
                               [types="{types}"] [sortAscending="{sort-ascending} (0|1)"] [countOnly="{isCountOnly} (0|1)"]
                               [attrs="{request-attrs}"] /> ## SearchDirectoryRequest

elements and attributes you can define within a <SearchDirectoryRequest> element:

XPath Required / Optional Description
@query Optional (0 or 1) Type: String
Query string - should be an LDAP-style filter string (RFC 2254)
@maxResults Optional (0 or 1) Type: Integer
Maximum results that the backend will attempt to fetch from the directory before returning an account.TOO_MANY_SEARCH_RESULTS error.
@limit Optional (0 or 1) Type: Integer
The maximum number of accounts to return (0 is default and means all)
@offset Optional (0 or 1) Type: Integer
The starting offset (0, 25, etc)
@domain Optional (0 or 1) Type: String
The domain name to limit the search to
@applyCos Optional (0 or 1) Type: 0|1
applyCos - Flag whether or not to apply the COS policy to account. Specify 0 (false) if only requesting attrs that aren't inherited from COS
@applyConfig Optional (0 or 1) Type: 0|1
whether or not to apply the global config attrs to account. specify 0 (false) if only requesting attrs that aren't inherited from global config
@sortBy Optional (0 or 1) Type: String
Name of attribute to sort on. Default is the account name.
@types Optional (0 or 1) Type: String
Comma-separated list of types to return. Legal values are:
accounts|distributionlists|aliases|resources|domains|coses
(default is accounts)
@sortAscending Optional (0 or 1) Type: 0|1
Whether to sort in ascending order. Default is 1 (true)
@countOnly Optional (0 or 1) Type: 0|1
Whether response should be count only. Default is 0 (false)
@attrs Optional (0 or 1) Type: String
Comma separated list of attributes

SearchDirectoryResponse

    <SearchDirectoryResponse [num="{count number} (Long)"] [more="{more-flag} (0|1)"]
                                [searchTotal="{search-total} (Long)"]> ## SearchDirectoryResponse
        List of any of: {
            <calresource name="{name}" id="{id}"> ## CalendarResourceInfo
                (<a n="{key}" /> ## Attr)*
             </calresource>
            <dl [dynamic="{dl-is-dynamic} (0|1)"] name="{name}" id="{id}"> ## DistributionListInfo
                (<dlm>{members} (String)</dlm>)*
                <owners>
                    (<owner [type="{grantee-type} (usr | grp | egp | all | dom | edom | gst | key | pub | email)"]
                                id="{grantee-id}" name="{grantee-name}" /> ## GranteeInfo)*
                </owners>
                (<a n="{key}" /> ## See /calresource/a [ ## Attr])*
             </dl>
            <alias targetName="{target-name}"
                       [type="{target-type} (account | calresource | cos | dl | group | domain | server | xmppcomponent | zimlet | config | global)"]
                       name="{name}" id="{id}"> ## AliasInfo
                (<a n="{key}" /> ## See /calresource/a [ ## Attr])*
             </alias>
            <account [isExternal="{is-external} (0|1)"] name="{name}" id="{id}"> ## AccountInfo
                (<a n="{key}" /> ## See /calresource/a [ ## Attr])*
             </account>
            <domain name="{name}" id="{id}"> ## DomainInfo
                (<a n="{key}" /> ## See /calresource/a [ ## Attr])*
             </domain>
            <cos id="{id}" name="{name}" [isDefaultCos="{is-default-cos} (0|1)"]> ## CosInfo
                (<a [c="{is-cos-attr} (0|1)"] [pd="{perm-denied} (0|1)"] n="{key}" /> ## CosInfoAttr)*
             </cos>
        }
    </SearchDirectoryResponse>

elements and attributes you can define within a <SearchDirectoryResponse> element:

XPath Required / Optional Description
@num Optional (0 or 1) Type: Long
number of counts
@more Optional (0 or 1) Type: 0|1
1 (true) if more accounts left to return
@searchTotal Optional (0 or 1) Type: Long
Total number of accounts that matched search (not affected by limit/offset)
/calresource Optional (0 or 1)
/calresource@name Required (only 1) Type: String
Name
/calresource@id Required (only 1) Type: String
ID
/calresource/a Optional (0 or more) Attributes
/calresource/a@n Required (only 1) Type: String
Key
/dl Optional (0 or 1)
/dl@dynamic Optional (0 or 1) Type: 0|1
Flags whether this is a dynamic distribution list or not
/dl@name Required (only 1) Type: String
Name
/dl@id Required (only 1) Type: String
ID
/dl/dlm Optional (0 or more) Type: {members} (String)
dl-members
/dl/owners Required (only 1)
/dl/owners/owner Optional (0 or more)
/dl/owners/owner@type Optional (0 or 1) Type: usr | grp | egp | all | dom | edom | gst | key | pub | email
Grantee type
/dl/owners/owner@id Required (only 1) Type: String
Grantee ID
/dl/owners/owner@name Required (only 1) Type: String
Grantee name
/dl/a Optional (0 or more) Attributes
See /calresource/a for more details.
/alias Optional (0 or 1)
/alias@targetName Required (only 1) Type: String
Target name
/alias@type Optional (0 or 1) Type: account | calresource | cos | dl | group | domain | server | xmppcomponent | zimlet | config | global
Target type
/alias@name Required (only 1) Type: String
Name
/alias@id Required (only 1) Type: String
ID
/alias/a Optional (0 or more) Attributes
See /calresource/a for more details.
/account Optional (0 or 1)
/account@isExternal Optional (0 or 1) Type: 0|1
Whether the account's zimbraMailTranport points to the designated protocol(lmtp) and server(home server of the account).
/account@name Required (only 1) Type: String
Name
/account@id Required (only 1) Type: String
ID
/account/a Optional (0 or more) Attributes
See /calresource/a for more details.
/domain Optional (0 or 1)
/domain@name Required (only 1) Type: String
Name
/domain@id Required (only 1) Type: String
ID
/domain/a Optional (0 or more) Attributes
See /calresource/a for more details.
/cos Optional (0 or 1)
/cos@id Required (only 1) Type: String
ID
/cos@name Required (only 1) Type: String
Name
/cos@isDefaultCos Optional (0 or 1) Type: 0|1
Flag whether is the default Class Of Service (COS)
/cos/a Optional (0 or more) Attributes
/cos/a@c Optional (0 or 1) Type: 0|1
Flags that this is a Class Of Service (COS) attribute.
/cos/a@pd Optional (0 or 1) Type: 0|1
Flags that the value of this attribute has been suppressed for permissions reasons
/cos/a@n Required (only 1) Type: String
Key