List properties and relationships of the directory Computer objects.
HTTP Request
POST /directoryComputers
Request headers
Header | Value |
Authorization | If required by Centero Agent Gateway configuration |
Key | Authentication key if required by Centero Agent Gateway configuration. Key can be passed also as URI parameter (like: /computerManagedGroupRules?Key=configuredkey) |
Accept | application/json |
Request Parameters
Following table shows the parameters available for the request.
Parameter | Type | Description |
Key | string | Optional. Authentication key if required by the Recast Agent Gateway configuration. Can be passed also as a request header |
$top | int | Optional. Number of computers to return on each request. Default is zero (0) that returns all computers |
$skip | int | Optional. Number of items to skip. If this value is set you need to specify also $top. Example combinations:
|
Request Body
In the request body, supply a JSON representation for performing Active Directory search. Following table shows the properties that are available when you list computers from Active Directory.
Property | Type | Description |
UseGlobalCatalog | bool | To use Active Directory Global Catalog for searching computers. |
SearchRoot | string | Active Directory distinguished name of the domain, organization unit or container where to search for computer objects. Search is always done to the search root and all organization units and containers below it. |
SortProperty | string | Specify AD attribute for ordering the results. Empty or null value does not use ordering |
SortDirection | string | If the SortProperty is specified then specify the ordering direction. Allowed values:
If empty or null then ascending ordering will be used |
Filter | string | Custom LDAP filter to use. Default filter if not set is: (&(objectClass=computer)) |
ReturnAttributes | string array | List of attributes to return from all found computers. |
Response
If successful, this method returns a 200 OK response code and a collection of directory Computer objects in the response body.
Example
Request
Here is an example of the request.
POST https://cgw.dns.domain/api/v1.0/directoryComputers?$top=2&$skip=0
Content-Type: application/json
{
"UseGlobalCatalog": false,
"SearchRoot": "OU=Workstations,DC=domain,DC=ad",
"SortProperty": "whenCreated",
"SortDirection": "Desc",
"Filter": "(&(objectClass=computer))",
"ReturnAttributes": [
"description",
"name"
]
}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://cgw.dns.domain/$metadata#directoryComputers",
"@odata.nextLink": "https://cgw.dns.domain/api/v1.0/directoryComputers?$top=2&$skip=2",
"value": [
{
"Guid": "91eba3a1-a803-4a22-b57f-94af33d1eda9",
"NativeGuid": "a1a3eb9103a8224ab57f94af33d1eda9",
"Path": "LDAP://CN=COMPUTER1,OU=Workstations,DC=domain,DC=ad",
"Attributes": {
"description": "John Doe laptop",
"name": "COMPUTER1"
}
},
{
"Guid": "2e7c8044-a2ce-41eb-ab01-3cb1ccca0ec1",
"NativeGuid": "44807c2ecea2eb41ab013cb1ccca0ec1",
"Path": "LDAP://CN=COMPUTER2,OU=Workstations,DC=domain,DC=ad",
"Attributes": {
"description": "John Doe DESKTOP",
"name": "COMPUTER2"
}
}
]
}