Using Get-DSEntry gives different output

Using Get-DSEntry gives different output

avatar

I'm trying to get all SshShell sessions using the DS powershell commands and found that Get-DSEntry gives different output depending on how i use the command.

Can you please explain why the command doesn't give the same output?

If i first have to run "Get-DSEntry -VaultId $Vault.Id -All" to get all entries and then again run "Get-DSEntry -EntryId <ID>" or "Get-DSEntry -VaultId $Vault.Id -FilterBy Name -FilterValue <NAME>" for each object that has connectionType 77 (or SshShell, which only the command with filtervalue shows) then i have to make a lot of unnecessary call to the API to get the information that in my opinion should come with getting all entries (except the secret data of cause).

Module version: 2023.2.0.6

(Get-DSEntry -VaultId $Vault.Id -All).Data | Where-Object {$_.Id -ieq 'c57e1505-e79e-4974-9b1f-f3eab6947333'}

connectionType          : 77
displayMode             : 1
displayMonitor          : 4
group                   : Test\TestFolder
id                      : c57e1505-e79e-4974-9b1f-f3eab6947333
name                    : TestSSH
permissions             : @{canView=True}
repositoryId            : 7e14f5e8-8747-482c-b2aa-91104866aafa
supportSessionRecording : True


(Get-DSEntry -VaultId $Vault.Id -FilterBy Name -FilterValue 'TestSSH').Data

CachedSecurityGroups   : 
SplittedGroupMain      : {Test, Test\TestFolder}
AttachmentCount        : 0
AttachmentPrivateCount : 0
ConnectionType         : SSHShell
ConnexionTypeIcon      : 
ConnexionTypeString    : 
Data                   : <?xml version="1.0"?>.....
DataAtRestDecrypted    : False
DeserializedConnection : 
Group                  : Test\TestFolder
GroupMain              : Test\TestFolder
Groups                 : {Test\TestFolder}
HandbookCount          : 0
ID                     : c57e1505-e79e-4974-9b1f-f3eab6947333
IntelligentCacheAction : AddUpdate
InventoryReportCount   : 0
IsPrivate              : False
MetaData               : Devolutions.RemoteDesktopManager.Business.Entities.ConnectionMetaDataEntity
MetaDataString         : <?xml version="1.0" encoding="utf-8"?>.....
Name                   : TestSSH
ParentID               : 
RepositoryID           : 7e14f5e8-8747-482c-b2aa-91104866aafa
SecurityGroup          : 00000000-0000-0000-0000-000000000000
TodoOpenCount          : 0
Version                : 


(Get-DSEntry -EntryId c57e1505-e79e-4974-9b1f-f3eab6947333).Data

resolvedCheckOutMode                     : 5
resolvedCheckOutCommentMode              : 1
resolvedAllowOffline                     : 1
resolvedSynchronizeDocumentToOfflineMode : 2
resolvedTemporaryAccessMode              : 3
resolvedCredentialConnectionId           : c57e1505-e79e-4974-9b1f-f3eab6947333
connectionType                           : 77
createdBy                                : account
createdDate                              : 2023-09-13 20:03:38
data                                     : ....
displayMode                              : 1
displayMonitor                           : 4
group                                    : Test\TestFolder
id                                       : c57e1505-e79e-4974-9b1f-f3eab6947333
modifiedBy                               : account
modifiedDate                             : 2023-09-13 20:05:56
name                                     : TestSSH
permissions                              : @{canView=True}
repositoryId                             : 7e14f5e8-8747-482c-b2aa-91104866aafa
resolvedTimeBasedUsageSettings           : @{timeBasedUsageDays=2}
sessionRecordingSettings                 : @{fileNameMode=3; mode=4; sessionRecordingTarget=1; cid=c57e1505-e79e-4974-9b1f-f3eab6947333}
supportSessionRecording                  : True
resolvedEventsLogsOptions                : @{openLogsOptions=; closeLogsOptions=; credentialsViewedLogsOptions=}
accessRequestResolvedAuthorizerSetting   : 2

All Comments (3)

avatar

Hello,

I verified with the PowerShell developer, and here are his comments:

  • The EntryID parameter is a lighter version of the entries. It was chosen to restrict the amount of data transferred.
  • For the type with Filter, the result is similar to using the AsRDMConnection switch. Get-DSEntry -EntryID $id -AsRDMConnection returns an object with the ConnectionInfo property, which is exactly what the command with Filter returns.
  • For the result with -All, the possibility of searching in all vaults implies too many entries, so a minimal object is returned. It is less necessary now that Search-DSEntry cmdlet exists.


Let us know if you need additional information!

Best regards,

Richard Boisvert

avatar

Hi

Thanks for the answers and i understand why you would restrict the amount of data transferred. But if you have to find all the entries you wish to get info about and then run a command against each entry again to the the extended dataset, wouldn't that be more data transferred than if you returned it all in the first place?

I didn't know about Search-DSEntry but i can use it and then for each entry run Get-DSEntry -EntryId to the the extended data where i can find the hostname i need.

What would be the right way to change the hostname of the entry?

avatar

Hello thoj,

To update an entry, you would need to use the cmdlet Update-DSEntryBase . To get the ID of the entry, it works well with the Search-DSEntry, as mentioned above.

Here is an example to update the hostname of an RDP session. This will search all vaults for the exact name you search for:

$id = (Search-DSEntry -By Name -Match ExactExpression -Value 'name of entry').data.id
$Entry = (Get-DSEntry -EntryId $id).Body.data
$Entry.data.host = "new hostname"
$Entry = (ConvertTo-Json $Entry -Depth 10)

$update = Update-DSEntryBase -jsonBody $Entry


Best regards,

Richard Boisvert