Direct Inward Dialing: +1 408 916 9393
This API allows you to locate any OU in your Active Directory.
Request URL format: http://<hostname>:<port>/RestAPI/SearchOU
Request parameters:
| Parameter name | Mandatory | Description |
| PRODUCT_NAME | Yes | Product name or module name from which the request is being sent; will be needed for auditing. |
| AuthToken | Yes | Authentication token that is generated either from the Delegation tab (Delegation > Configuration > Technician Authtokens) or from the My account tab (My Account > Active Authtokens) in the top right corner of the product. |
| domainName | Yes | Name of the domain in which the search is to be performed. |
| range | Yes | Number of OUs to be returned in the request's response. |
| startIndex | Yes | Starting index for the OU details result. |
| searchText | No | Text to be used in the search. |
| refresh | No | Boolean type. If true, the server will refresh and update the changes from AD to ADManager Plus, and then send the updated results. |
| sortColumn | No | Name of the column based on which the search result will be sorted. Any one of the columns in the search result can be used to sort the result. |
| ascending | No | Boolean type. If true, the search results are arranged in ascending order. If false, the results will be shown in descending order.
Note: By default, the results are in ascending order. |
| select | No | LDAP attributes that are to be displayed in the search result. |
| filter | No | LDAP attributes to refine the search.
Note: If you want to use filter to search, don't use searchText. |
| domainList | No | The domains in which the OU is to be searched for. |
Response:
The response will be a JSON array string which contains the list of JSONObjects.
| Parameter name | Description |
| count | Total number of OUs with the given search criteria. |
| OuLists | JSONArray of the OU details. Each JSONObject in the array represents an OU in the search result. The JSONObject contains the key/value pair of attributes of the OU and their corresponding values. |
| statusMessage | Contains the appropriate message if an issue or error occurs while processing the request. |
| status | Status of the search operation. Displays SUCCESS on successful completion of the request. |
Sample input/output:
Request
http://admanager:8080/RestAPI/SearchOU?domainName=test.com&AuthToken=3187f9d3-da6b-4bc2-aaff-a73495753b8d&range=2&startIndex=1&refresh=true&sortColumn=NAME&ascending=ascending&searchText=user
Response:
{
"count": 15,
"OuLists": [
{
"OU_NAME": "test.com",
"DISTINGUISHED_NAME": "OU=Users,DC=test,DC=com",
"CITY": "-",
"COUNTRY": "-",
"STATE_PROVINCE": "-",
"OBJECT_GUID": "{F0D740EC-B741-46A8-A506-0AC71406FB7D}",
"MANAGER": "-",
"NAME": "Users"
},
{
"OU_NAME": "test.com",
"DISTINGUISHED_NAME": "OU=RealUser,DC=test,DC=com",
"CITY": "-",
"COUNTRY": "-",
"STATE_PROVINCE": "-",
"OBJECT_GUID": "{05A3BE59-F17D-4320-8F37-1A410F871247}",
"MANAGER": "-",
"NAME": "RealUser"
}
],
"statusMessage": "",
"status": "SUCCESS"
}
Request with filter and select parameters
http://admanager:8080//RestAPI/SearchOU?domainName=test.com&AuthToken=0e0f9f3c-aec4-486a-9863-cf22ec6dfe99&range=4&startIndex=1&refresh=true&sortColumn=NAME&ascending=ascending&select=name,distinguishedName&filter=name:contains:Test-OU
Response:
{
"count": 6,
"OuLists": [
{
"DISTINGUISHED_NAME": "OU=Test-OU--1,DC=test,DC=com",
"NAME": "Test-OU-1"
},
{
"DISTINGUISHED_NAME": "OU=Test-OU--2,DC=test,DC=com",
"NAME": "Test-OU-2"
},
{
"DISTINGUISHED_NAME": "OU=Test-OU--3,DC=test,DC=com",
"NAME": "Test-OU-3"
},
{
"DISTINGUISHED_NAME": "OU=Test-OU--4,DC=test,DC=com",
"NAME": "Test-OU--4"
}
],
"statusMessage": "",
"status": "SUCCESS"
}
Example: (name:contains:Test1OU) wherein,