Support
 
Phone Live Chat
 
Support
 
US: +1 888 720 9500
US: +1 800 443 6694
Intl: +1 925 924 9500
Aus: +1 800 631 268
UK: 0800 028 6590
CN: +86 400 660 8680

Direct Inward Dialing: +1 408 916 9393

 
 
 
 
 
Search Computer API
 

Search Computer API

This API allows you to locate any computer object in your Active Directory.

Request URL format: http://<hostname>:<port>/RestAPI/SearchComputer

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 obtained using the Generate AuthToken API.
domainName Yes Name of the domain in which the search is to be performed.
range Yes Number of computer details to be returned in the request's response.
startIndex Yes Starting index for the computer details result.
searchText No Text to be used in the search.
refresh No Boolean type. On 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 computer 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 computers with the given search criteria.
ComputerList JSONArray of the computer details. Each JSONObject in the array represents a computer in the search result. The JSONObject contains the key/value pair of attributes of the computer 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/SearchComputer?domainName=test.com&AuthToken=3187f9d3-da6b-4bc2-aaff-a73495753b8d&range=2&startIndex=1&refresh=true&sortColumn=COMPUTER_NAME&ascending=ascending&searchText=Test-Computer

Response:

{
    "ComputerList": [
        {
            "COMPUTER_NAME": "Test-Computer-1",
            "DISTINGUISHED_NAME": "CN=Test-Computer-1,OU=Computers,DC=test,DC=com",
            "OU_NAME": "Computers",
            "VERSION": "-",
            "SID_STRING": "S-1-5-21-2058198098-2931619084-4035890149-134969",
            "OBJECT_GUID": "{2C9BE8C0-224D-4DA9-B5E6-01C422839747}",
            "MANAGER": "-",
            "OPERATING_SYSTEM": "-",
            "DEPARTMENT": "-",
            "SAM_ACCOUNT_NAME": "Test-Computer-1$"
        },
        {
            "COMPUTER_NAME": "Test-Computer-2",
            "DISTINGUISHED_NAME": "CN=Test-Computer-2,OU=Computer,DC=test,DC=com",
            "OU_NAME": "Computer",
            "VERSION": "-",
            "SID_STRING": "S-1-5-21-2058198098-2931619084-4035890149-8429",
            "OBJECT_GUID": "{AF4A2A32-374C-4D74-A18A-DAE86AD45DBB}",
            "MANAGER": "-",
            "OPERATING_SYSTEM": "-",
            "DEPARTMENT": "-",
            "SAM_ACCOUNT_NAME": "Test-Computer-2$"
        }
    ],
    "count": 4,
    "statusMessage": "",
    "status": "SUCCESS"
}

Request with filter and select parameters

http://admanager:8080/RestAPI/SearchComputer?domainName=test.com&AuthToken=0e0f9f3c-aec4-486a-9863-cf22ec6dfe99&range=4&startIndex=1&refresh=true&sortColumn=COMPUTER_NAME&ascending=ascending&filter=name:contains:Test-Computer&select=sAMAccountName,name,distinguishedName

Response

{
    "ComputerList": [
        {
            "COMPUTER_NAME": "Test-Computer-1",
            "DISTINGUISHED_NAME": "CN=Test-Computer-1,OU=Computer,DC=test,DC=com",
            "SAM_ACCOUNT_NAME": "Test-Computer-1$"
        },
        {
            "COMPUTER_NAME": "Test-Computer-2",
            "DISTINGUISHED_NAME": "CN=Test-Computer-2,OU=Computer,DC=test,DC=com",
            "SAM_ACCOUNT_NAME": "Test-Computer-2$"
        },
        {
            "COMPUTER_NAME": "Test-Computer-3",
            "DISTINGUISHED_NAME": "CN=Test-Computer-3,OU=Computer,DC=test,DC=com",
            "SAM_ACCOUNT_NAME": "Test-Computer-3$"
        },
        {
            "COMPUTER_NAME": "Test-Computer-4",
            "DISTINGUISHED_NAME": "CN=Test-Computer-4,OU=Computer,DC=test,DC=com",
            "SAM_ACCOUNT_NAME": "Test-Computer-4$"
        }
    ],
    "count": 7,
    "statusMessage": "",
    "status": "SUCCESS"
}
NOTE
  • The default admin account will not be considered as a help desk technician.
  • Ensure that you URL encode all the special and reserved characters used in REST API requests. Since the client sending the request (browser, postman, or TP tools) does not fall under ADManager Plus, encoding the URL for special, reserved, and unsafe characters is solely the users' responsibility.
  • Reserved characters include ; / ? : @ = &
    Unsafe characters include < > # % { } | \ ^ ~ [ ] ` "'
  • The filter parameter must be specified in the following format: (<LDAP/special key>:<operator>:<value> <logicalOperator> (<LDAP/special key>:<operator>:<value>.
    Example: (description:contains:Test1Computer)
    wherein,
    • Special characters (,), and \ must be escaped with a backslash when given as a value. For instance, the value "Test\1(Computer)" must be specified as (description:conatins:Test\\1\(Computer\)).
    • LDAP attributes and special keys are case-sensitive. Operators and logical operators, on the other hand, are case-insensitive.
    • The following special keys, operators, and logical operators can be used:
      • Operators: equal, equalCaseSensitive, notEqual, greaterThan, greaterEqual, lessThan, lessEqual , endsWith, notEndsWith, startsWith, notStartsWith, contains, notContains, like and notLike.
      • Logical operators: and and or.

ADManager Plus Trusted By

The one-stop solution to Active Directory Management and Reporting
Email Download Link