Phone Live Chat
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

Add Computers To Groups API

Add Computers To Groups API

This API helps in adding computer objects to an Active Directory group from your application.

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

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 computer accounts are present.
inputFormat Yes Details of each computer account to be modified. This attribute should be a JSONArray string and must be in the format mentioned below:
[<JSONObject>, <JSONObject>, <JSONObject>];

JSONObject: The key/value pair of LDAP attributes and the values.
Example JSONArray:

NOTE: You can specify any of the following attributes as search criteria to locate computer objects using REST API requests:
sAMAccountName, distinguishedName, objectGUID and objectSID

addGroup No List of all sAMAccountName of the groups.
primaryGroup No sAMAccountName of the primary group.
objectType No To set the object type to computer.


The response will be a JSON array string which contains the list of JSONObjects.

Parameter name Description
sAMAccountName sAMAccountName of the computer.
objectGUID objectGUID of the computer.
objectSID objectSID of the computer.
userPrincipalName Name of the computer.
ouName Name of the container where the computer to be added is located.
statusMessage Contains the appropriate message if an issue or error occurs while processing the request.
status Contains 1 or 0, indicating whether the operation is a success or failure.

Sample input/output:




        "sAMAccountName": "Test-Computer-1$",
        "objectGUID": "{AF4A2A32-374C-4D74-A18A-DAE86AD45DBB}",
        "objectSID": "S-1-5-21-2058198098-2931619084-4035890149-8429",
        "userPrincipalName": "Test-Computer-1",
        "ouName": "OU=Computers,DC=test,DC=com",
        "statusMessage": "Successfully modified.",
        "status": "1"

ADManager Plus Trusted By

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