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

 
 
 
 
 
Enable User

Enable User API

This API can be used to enable any disabled user account . It can also be used to set the expiry date of user accounts.

Request URL (JSON) format: http://<hostname>:<port>/RestAPI/EnableUser

Request parameters:

Parameter Name Mandatory Description
PRODUCT_NAME Yes Product name / 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 Domain name of the user accounts.
inputFormat Yes Details of each user account to be enabled. This attribute should be a JSONArray string and must be in format mentioned below.
[<JSONObject>, <JSONObject>,
<JSONObject>];
JSONObject - key/value pair of ldap
attributes and the values
Sample code in java:
JSONArray userDetails = new
JSONArray();
JSONObject json = new JSONObject();
json.put("sAMAccountName", "John");
userDetails.put(json);
json = new JSONObject();
json.put("sAMAccountName", "Mat");
userDetails.put(json);

NOTE:

You can specify any of the following attributes as search criteria to locate user objects using REST API requests:

  1. sAMAccountName
  2. UserPrincipalName
  3. distinguishedName
  4. mail
  5. employeeID
  6. objectGUID
  7. objectSid
accountExpires No If you do not want to set an account expiry date, specify the value of the accountExpires parameter as Never. Otherwise use EndOf if you want to set the account expiry date.
expireTimes No This parameter is mandatory only if End Of option is specified for the accountExpires parameter. The expireTime must be set in the MM-dd-yyyy format.

Response:

The response will be a JSONArray string which contains the list of JSONObjects. Each JSONObject in the list represents a user account sent in the inputFormat parameter in the request. Each object will contain the following properties.

Parameter Name Description
userPrincipalName userPrincipalName of the user.
sAMAccountName sAMAccountName of the user.
objectSID objectSID of the user
statusMessage Contains the appropriate message if an issue/error occurs while processing the request.

Sample Input / Output

Sample Request 1:

http://Byron:8080/RestAPI/EnableUser?AuthToken=a70d9e6c-4167-4de4-a6a1-3b3aff50c82&PRODUCT_NAME=MODULE_NAME&domainName=admanagerplus.com&inputFormat=[{" sAMAccountName":"colin.altonen"}]&accountExpires=Never

Sample Request 2:

http://Byron:8080/RestAPI/DisableUser?AuthToken=a70d9e6c-4167-4de4-a6a1-3b3aff50c82&PRODUCT_NAME=MODULE_NAME&domainName=admanagerplus.com&inputFormat=[{" sAMAccountName":"colin.altonen"}]&accountExpires=EndOf&expireTime=12-21-2018

Sample Response:

[{"userPrincipalName":"colin.altonen@admanagerplus.com","sAMAccountName":"colin.altone n","objectSID":"S-1-5-21-2996321955-1937665885-1535019402-3881","statusMessage":"Successfully modified."}]

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 < > # % { } | \ ^ ~ [ ] ` "'

ADManager Plus Trusted By

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