Add Active Directory Domains ​
POST /api/activedirectory
Adding a new Active Directory Domain can be achieved by making a POST request on the URL, with appropriate fields forming the HTTP message body. You must use the Active Directory Domain API Key.
The PowerShell example below creates an Active Directory Domain record with various fields specified. API Key can be specified in the Header, or the Body of the POST
Powershell
#JSON data for the object
$Body = @{
ADDomainNetBIOS = "clickstudios"
ADDomainLDAP = "dc=clickstudios,dc=com,dc=au"
FQDN = "clickstudios"
DefaultDomain = "False"
PAReadID = "1"
SiteID = "0"
UsedForAuthentication = "False"
Protocol = "2"
DomainControllerFQDN = ""
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/api'
$result = Invoke-Restmethod -Method Post -Uri $PasswordstateURL'/activedirectory -ContentType "application/json"-Body $jsonData -Header @{ "APIKey" = "<apikey>" }
Write-Output $resultThe following fields can be specified when creating Active Directory Domain records:
| Heading | Data Type | Description |
|---|---|---|
| ADDomainNetBIOS | String (50) | The NetBIOS value for the Active Directory Domain entry |
| ADDomainLDAP | String (500) | The LDAP Query String value for the Active Directory Domain entry e.g. dc=clickstudios,dc=com,dc=au |
| FQDN | String (100) | The FQDN value for the Active Directory Domain entry e.g. clickstudios.com.au |
| DefaultDomain | Boolean | Whether the domain record will be selected as the Default Domain on the authentication screens in Passwordstate |
| PAReadID | Integer | The PAReadID field is the corresponding PrivilegedAccountID value for the Privileged Account Credential entry to be associated with the domain. This Privileged Account Credential is required for looking up/synchronizing Active Directory Security Groups and User Accounts into Passwordstate. Typically this account only requires Read-Only access to your Domain, unless you also use the Privileged Account Credential for other features like Privileged Account Management6 |
| SiteID | Integer | The SiteID for the Active Directory Domain entry. A value of zero means the entry is associated with the Site 'Internal'. "Sites" in Passwordstate refer to the Remote Site Locations module. If this module is not being used, then the SiteID of '0' will always be returned |
| UsedForAuthentication | Boolean | True or False - whether the Active Directory Domain record is to be shown on Authentication screens in Passwordstate |
| Protocol | Integer | 0 for LDAP (UDP Port 389), 1 for LDAPS (TCP Port 636), and 2 for Kerberos ((UDP/TCP Port 88 and 464) |
| DomainControllerFQDN | String (100) | This field should only be required if you need to connect to a specific domain controller to improve performance of the Active Directory synchronization process - for synchronization Security Groups and User Accounts. This field is not used for any authentication processes in Passwordstate |