Trigger Sync to an Active Directory

To initiate synchronization to an active directory, you retrieve the domain name of the directory then use that domain name in the API request to synchronize the groups and users to that directory.

Prerequisites

  • Log in to vRealize Automation as a system administrator or a tenant administrator.
  • Verify that the appliance name and fully qualified domain name of the vRealize Automation instance are available.
  • Verify that you have a valid HTTP bearer token that matches your login credentials. See REST API Authentication.

Procedure

  1. Retrieve the directories for the specified tenant.
    curl --insecure -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer $token" https://$vRA/identity/api/$tenantId/directories
    For details regarding input and output for this request, see Syntax for Retrieving Directories.
  2. Examine the result to find the domain name of the directory for which you want to initiate synchronization.
    {
       "@type": "IdentityStore",
       "domain": "demo.ad-example.local",
       "name": "Demo AD for sync",
       "description": "Demo AD for sync",
       "alias": "",
       "type": "AD",
       ...
    }
    In this example, the directory is Demo AD for sync with domain name demo.ad-example.local.
  3. Use the domain name to initiate the synchronization process.
    curl -X POST --insecure -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: Bearer $token” -H "Cache-control: no cache" https://$vRA/identity/api/tenants/$tenantId/directories/demo.ad-example.local/sync
    
    For details regarding input and output for this request, see Syntax for Synchronizing the Active Directory.
  4. Check the state of the synchronization process.
    curl -X GET --insecure -H "Accept: application/json" -H "Content-type: application/json" -H "Authorization: Bearer $token” -H "Cache-control: no cache" https://$vRA/identity/api/tenants/$tenantId/directories/demo.ad-example.local/status
    
    For details regarding input and output for this request, see Syntax for Checking the Synchronization Process.
  5. Examine the result for the value of the syncStatus attribute.
    {
        "syncStatus": {
            "status": "RUNNING",
            "message": null
        }
    }
    In this example, the status is RUNNING.

Results

When the synchronization process completes successfully, the status is COMPLETED and the directory with the name Demo AD for sync appears with synced groups and users under Administration > Directories in the vRealize Automation interface.