Powershell - New-DSRDSEntry--Update-DSRDSEntry Link Credential / VPN DVLS configuration

Powershell - New-DSRDSEntry--Update-DSRDSEntry Link Credential / VPN DVLS configuration

0 vote

avatar

Hello Devolutions,

We would like to have the ability to create or update an RDP session via the cmdlet New-DSRDPEntry / Update-DSRDPEntry command, and link an existing credential entry to it.

We also want to configure the default DVLS Gateway in the RDP session using the cmdlet.

Thanks for your help !

All Comments (2)

avatar

Hello,

Apologies for the delayed response.

Regarding the credential linkage, we will add a parameter to accept the credential ID.

For the default DVLS Gateway, I want to confirm your expectations. Would you like the option to edit other properties? If so, could you specify which ones? For instance:

  • Basic settings like connect mode (always connect, connect if unable to ping/port, etc.) or close mode (manual, on session close, confirm)
  • Any advanced settings
  • Use another gateway


Your feedback will help us determine the best approach for implementation. If you intend to always use the default gateway, set to always connect and close with the session, I can add a simple switch to specify that the default DVLS gateway must be used.

Please let me know your preferences.

Best regards,
Maxime

avatar

Hello,

We would like to have the ability to create or update an RDP session via the cmdlet New-DSRDPEntry / Update-DSRDPEntry command, and link an existing credential entry to it.


Two new parameters have been added to the New-DSRDPEntry and Update-DSRDPEntry cmdlets:

  • CredentialMode: Three values are accepted:
    • CredentialEntry: Entry in the vault
    • PrivilegedAccount: A privileged account
    • PrivateVaultSearch: Find by name in the user vault
  • LinkedCredentialValue: Depending on the credential mode, this parameter accepts either the ID or name of the entry.


Here is an example demonstrating how to link an existing entry:

$entryToLinkID = 'some-id'
$entryToUpdateID = 'another-id'
Update-DSRDPEntry -EntryID $entryToUpdateID -CredentialMode CredentialEntry -LinkedCredentialValue $entryToLinkID


We also want to configure the default DVLS Gateway in the RDP session using the cmdlet.


No new parameters have been added to the DSRDPEntry cmdlets for configuring the default DVLS gateway, as I aimed to avoid introducing too many parameters. Additionally, no new cmdlet has been created to handle the VPN/Tunnel/Gateway configuration, since this would be excessive for simply setting the default DVLS gateway.

For a specific configuration, the recommended approach is:

  1. Set the default gateway on an entry via the web interface.
  2. Fetch the entry using Get-DSEntry ($entry).
  3. Review the $entry.data.vpn property.
  4. Reproduce the same value in other entries that you wish to modify.


Here is a simple PowerShell example to set the default DVLS gateway:

$entryID = 'some-id'
$entry = Get-DSEntry -EntryID $entryID
$entry.data.vpn = @{
    application = [Devolutions.RemoteDesktopManager.VPNApplication]::DevolutionsGateway
    closeMode = [Devolutions.RemoteDesktopManager.VPNCloseMode]::OnDisconnect
    devolutionsGatewayID = '6ccf937c-7a98-4106-b951-815471ec649b'
    mode = [Devolutions.RemoteDesktopManager.VPNMode]::AlwaysConnect
    enableAutoDetectIsOnlineVPN = 2
}
Update-DSEntryBase -JsonBody (ConvertTo-Json -InputObject $entry -Depth 10)


This approach leverages the existing configuration mechanisms without the need for additional cmdlets.

Should you require further examples or have suggestions for new cmdlets, feel free to reach out.

Best regards,
Maxime