Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Queries number of entries in search results.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
LDAP | 6.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
Parameter | Description | Example |
---|---|---|
LDAPRef | The reference number for the LDAP connection. | $ldap |
Returns number or error.
Query number of search results:
Set Variable [$EntryCount; Value:MBS("LDAP.SearchResult.Count"; $ldap)]
Loop over search results:
# loop over entries
Set Variable [$EntryCount; Value:MBS("LDAP.SearchResult.Count"; $ldap)]
Set Field [LDAP Query::Entry Count; $EntryCount]
If [$EntryCount > 0]
Set Variable [$EntryIndex; Value:0]
Loop
# get info for entry
Set Variable [$EntryName; Value:MBS("LDAP.SearchResult.DistinguishedName"; $ldap; $EntryIndex)]
# loop over attributes
Set Variable [$AttributeCount; Value:MBS("LDAP.SearchResult.AttributeCount"; $ldap; $EntryIndex)]
If [$AttributeCount]
Set Variable [$AttributeIndex; Value:0]
Loop
# get detail for attribute
Set Variable [$AttributeCount; Value:MBS("LDAP.SearchResult.AttributeCount"; $ldap; $EntryIndex)]
Set Variable [$EntryName; Value:MBS("LDAP.SearchResult.DistinguishedName"; $ldap; $EntryIndex)]
Set Variable [$AttributeName; Value:MBS("LDAP.SearchResult.AttributeName"; $ldap; $EntryIndex; $AttributeIndex)]
Set Variable [$AttributeValues; Value:MBS("LDAP.SearchResult.AttributeValues"; $ldap; $EntryIndex; $AttributeIndex; 1)]
# store in a record
New Record/Request
Set Field [LDAP Query::Entry; $EntryName]
Set Field [LDAP Query::Attribute; $AttributeName]
Set Field [LDAP Query::Values; $AttributeValues]
Commit Records/Requests [No dialog]
# next
Set Variable [$AttributeIndex; Value:$AttributeIndex + 1]
Exit Loop If [$AttributeIndex = $AttributeCount]
End Loop
End If
Set Variable [$EntryIndex; Value:$EntryIndex + 1]
Exit Loop If [$EntryIndex = $EntryCount]
End Loop
End If
Created 15th December 2015, last changed 16th December 2015
LDAP.SearchResult.AttributeValuesByName - LDAP.SearchResult.DistinguishedName
Feedback: Report problem or ask question.