PowerShell query for filtered list of entries

Resolved

PowerShell query for filtered list of entries

avatar

Hello all,

We previously used the MSSQL shared data source and in one of my scripts I would pull a filtered list of entries from RDM using this:

Import-Module -Name Devolutions.PowerShell -Force
$RdmList = Get-RDMSession | Where-Object { $_.ConnectionType -like "RDP*" -or $_.ConnectionType -like "SSH*" }

Now we use the Devolutions Server data source and this no longer appears to work. Can someone point me in the right direction of how I would go about getting a filtered list of entries from the data source using PowerShell 7, Remote Desktop Manager 2024.1.25.0 or newer, and Devolutions Server 2024.1.11.0 or newer?

Thank you!

--

Griffeth Barker

💻 Call/Chat on Microsoft Teams

📧 Send me an email

🔗 Connect on LinkedIn

All Comments (7)

avatar

Hello,

Have you updated the Devolutions.PowerShell module to the latest version 2024.1.5? To get the current installed version, you can use the Get-RDMInstance cmdlet.

https://www.powershellgallery.com/packages/Devolutions.PowerShell/2024.1.5

Here is the command to update it.

Update-Module -Name Devolutions.PowerShell -RequiredVersion 2024.1.5 -Force

The command you use should work on a DVLS data source. Are you connected to your DVLS data source from PowerShell?

Method 1 from the following article explains how to create a DVLS data source in RDM using an Application Key. To list the entries, you need to grant proper permissions to the application key on the vault where the entries are located.

https://docs.devolutions.net/kb/devolutions-powershell/devolutions-server/powershell-connectivity/

Let us know if you have any more questions.

Best regards,

Érica Poirier

avatar

Hello,

Have you updated the Devolutions.PowerShell module to the latest version 2024.1.5? To get the current installed version, you can use the Get-RDMInstance cmdlet.

https://www.powershellgallery.com/packages/Devolutions.PowerShell/2024.1.5

Here is the command to update it.

Update-Module -Name Devolutions.PowerShell -RequiredVersion 2024.1.5 -Force

The command you use should work on a DVLS data source. Are you connected to your DVLS data source from PowerShell?

Method 1 from the following article explains how to create a DVLS data source in RDM using an Application Key. To list the entries, you need to grant proper permissions to the application key on the vault where the entries are located.

https://docs.devolutions.net/kb/devolutions-powershell/devolutions-server/powershell-connectivity/

Let us know if you have any more questions.

Best regards,

Hi, Erica,

Thank you for your quick response! I forgot to update the module when I upgraded my RDM client. I used the command you provided to upgrade it and it showed successful but Get-RDMInstance still returns an ApplicationVersion of 2024.1.3.0 for some reason.

I figure I need to resolve that before tackling the error I'm getting when setting the data source using Method 1 from the documentation you linked, which is as shown below:

--

Griffeth Barker

💻 Call/Chat on Microsoft Teams

📧 Send me an email

🔗 Connect on LinkedIn

avatar

Hello Griffeth,

Thank you for your feedback.

It seems that this PowerShell session cannot modify the file containing the data sources. The destination path can be obtained with the Get-RDMInstance cmdlet. Make sure you have the right to create and modify files in that location.

Best regards,

Érica Poirier

avatar

Hi, Erica,

I checked on this and can confirm I do have rights to create and modify files in that location:

PS C:\Users\REDACTED>
PS C:\Users\REDACTED> $rdmPath = (Get-RDMInstance).OptionFileName

PS C:\Users\REDACTED> (Get-Acl -Path ((Get-RDMInstance).OptionFileName)).Access | Format-Table -IdentityReference, FileSystemRights -AutoSize

IdentityReference      FileSystemRights
-----------------      ----------------
NT AUTHORITY\SYSTEM         FullControl    # I also tried from the SYSTEM context, but had the same issue
BUILTIN\Administrators      FullControl    # This is the local administrators group of which I am also a member
REDACTED\REDACTED           FullControl    # This is my privileged account that is running my PowerShell session

PS C:\Users\REDACTED>

Not sure what is causing the issue, but I'll keep poking at it. I appreciate your help along the way!

--

Griffeth Barker

💻 Call/Chat on Microsoft Teams

📧 Send me an email

🔗 Connect on LinkedIn