Add Remote Session Credential ​
POST /api/rscredentials
Adding a new Remote Session Credential object can be achieved by making a POST request on the URL, with appropriate fields forming the HTTP message body. You must use the Remote Session Credentials API Key.
The PowerShell example below creates a Remote Session Credential record with various fields specified.
Powershell
#JSON data for the object
$Body = @{
Description = "RDP Sessions Domain Machines"
RemoteConnectionType = "RDP"
PasswordID = "57783"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/api'
$result = Invoke-Restmethod -Method Post -Uri $PasswordstateURL'/rscredentials' -ContentType "application/json" -Body $jsonData -Header @{ "APIKey" = "<apikey>" }
Write-Output $result