Add Remote Site Location ​
POST /api/remotesitelocations
Adding a new Remote Site Location entry can be achieved by making a POST request on the URL, with appropriate fields forming the HTTP message body. You must use the Remote Site Locations API Key.
The PowerShell example below creates a Remote Site Location 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 = @{
SiteLocation ="Contoso"
PollFrequency ="5"
MaintenanceStart ="13"
MaintenanceFinish ="14"
PurgeSessionRecordings ="0"
DiscoveryThreads ="1"
UseSSLPowerShell ="False"
AllowedIPRanges = @("127.0.0.1", "192.168.1.1-192.168.1.3")
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/api'
$result = Invoke-Restmethod -Method Post -Uri $PasswordstateURL'/remotesitelocations -ContentType "application/json"-Body $jsonData -Header @{ "APIKey" = "<apikey>" }
Write-Output $resultThe following fields can be specified when creating Remote Site Location records:
| Heading | Data Type | Description |
|---|---|---|
| SiteLocation | String (100) | The description of the Remote Site Location entry |
| PollFrequency | Integer | The time in minutes in which the Remote Agent will poll back to the API to look for new work items i.e. Discovery Jobs, Password Resets, Account Validations |
| MaintenanceStart | String (2) | The start hour for a maintenance period where the agent will not poll back for any new work items. Hour is specified in 24 hour format i.e. 1am would be specified as 01, and 1pm would be specified as 13 (use 2 digit values) |
| MaintenanceFinish | String (2) | The finish hour for a maintenance period where the agent will not poll back for any new work items |
| GatewayURL | String (100) | If using the Remote Session Gateway which can be configured with the Remote Site Locations agent, specify the URL here for connecting to the gateway |
| PurgeSessionRecordings | Integer | If recording remote sessions when using the Remote Session Gateway, this field indicates when old records will be automatically deleted - value is specified in Days |
| DiscoveryThreads | Integer | When performing Account Discovery Jobs, the fields indicates how many concurrent threads will be executed when querying different hosts |
| UseSSLPowerShell | Boolean | Whether or not to use the -UseSSL parameter in PowerShell scripts for the Invoke-Command cmdlet |
| AllowedIPRanges | String (NA) | This field allows you to restrict which IP Addresses the installed Agent can communicate back to the API on. Individual IP Addresses can be specified, or ranges in the format of ranges in the format of 192.168.1., or 192.168.., or 192..., or 192.168.1.1-192.168.2.25 |