Search Remote Session Credentials ​
GET /userapi/rscredentials
Searching for Remote Session Credentials can be achieved via multiple criteria, as outlined by the fields below. You can search using just one field, or multiple to further narrow down the search results.
The user executing the API script must be given access to the following:
- On the screen Administration -> Feature Access -> Hosts tab : 'Specify which users are allowed to have access to the main Hosts Menu'
- The search results will only return Remote Session Credentials the user currently has access to
- CredentialID
- Description
- RemoteConnectionType
- SiteID
- SiteLocation
Powershell
# Search by CredentialID
$PasswordstateUrl = 'https://passwordstate/userapi/rscredentials/?CredentialID=<value>'
# Search by Description
$PasswordstateUrl = 'https://passwordstate/userapi/rscredentials/?Description=<value>'
# Search by Description and Remote Connection Type
$PasswordstateUrl = 'https://passwordstate/userapi/rscredentials/?Description=<value>&RemoteConnectionType=<value>'
# Search by SiteID
$PasswordstateUrl = 'https://passwordstate/userapi/rscredentials/?SiteID=<value>'
# Search by Site Location
$PasswordstateUrl = 'https://passwordstate/userapi/rscredentials/?SiteLocation=<value>'
# Search by Description and Site Location
$PasswordstateUrl = 'https://passwordstate/userapi/rscredentials/?Description=<value>&SiteLocation=<value>'
Invoke-Restmethod -Method GET -Uri $PasswordstateUrl -Header @{ "UserID" = "<UserID>" ; "APIKey" = "<APIKey>" }Json
# Response
HTTP/1.1 200
[
{
"CredentialID":"1011",
"Description":"RDP Sessions Domain Machines",
"HostName":"",
"HostNameExclude":"",
"HostType":"",
"OperatingSystems":"",
"RemoteConnectionType":"RDP",
"RemoteConnectionParameters":"",
"PasswordID":"57783",
"PasswordListID":"183",
"PasswordList":"Active Directory Accounts",
"ImageFileName":"activedirectory.png",
"TreePath":"\Infrastructure\Active Directory Accounts",
"ProvideAccessReason":"False",
"Title":"My Domain Account",
"UserName":"userxyz",
"SiteID":"0",
"SiteLocation":"Internal"
}
]