Search Remote Session Credential Permissions ​
GET /userapi/rscredentialpermissions
Searching for Remote Session Credential permissions 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'
- Search results will only return Remote Session Credentials the user has access to themselves
- CredentialID
- Description
- RemoteConnectionType
- SiteID
- SiteLocation
- UserID (UserID is the user in Passwordstate, as found on the screen Administration -> UserAccounts)
- SecurityGroupID (SecurityGroupID is the security group in Passwordstate, as found on the screen Administration -> SecurityGroups)
If UserID and SecurityGroupID are returned as both "0", this means permissions are applied for "All Users & Security Groups".
Powershell
# Search Permissions by CredentialID
$PasswordstateUrl = 'https://passwordstate/userapi/rscredentialpermissions/?CredentialID=<value>'
# Search Permissions by Description
$PasswordstateUrl = 'https://passwordstate/userapi/rscredentialpermissions/?Description=<value>'
# Search Permissions by Description and Remote Connection Type
$PasswordstateUrl = 'https://passwordstate/userapi/rscredentialpermissions/?Description=<value>&RemoteConnectionType=<value>'
# Search Permissions by SiteID
$PasswordstateUrl = 'https://passwordstate/userapi/rscredentialpermissions/?SiteID=<value>'
# Search by Permissions Site Location
$PasswordstateUrl = 'https://passwordstate/userapi/rscredentialpermissions/?SiteLocation=<value>'
# Search by Permissions for all Credentials By UserID i.e. which credentials does a specific user have
$PasswordstateUrl = 'https://passwordstate/userapi/rscredentialpermissions/?UserID=<value>'
# Search by Permissions for all Credentials By SecurityGroupID i.e. which credentials does a specific security group have
$PasswordstateUrl = 'https://passwordstate/userapi/rscredentialpermissions/?SecurityGroupID=<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",
"UserID":"domain\username",
"SecurityGroupID":"0",
"AccessExpiresAt":"",
"SiteID":"0",
"SiteLocation":"Internal"
}
]