having issues getting passwords via the powershell module

having issues getting passwords via the powershell module

avatar

trying to find the correct module to allow me to grab the entry password for a credential (Username / Password) and saw this in the powershell module. Really stumped on how to pull a password via powershell.

dvls issue.png

All Comments (5)

avatar

Hello,

You were in the correct cmdlet! If you want all of the credentials, simply use (Get-DSEntrySensitiveData -EntryId "ID of the entry").body.data.credentials

If you want only the password, simply add .password at the end: (Get-DSEntrySensitiveData -EntryId "ID of the entry").body.data.credentials.password

forum image

Best regards,

Richard Boisvert

avatar

Hi, I am unable to retrieve a password using the commands you suggested. I am getting this message:

54 | … $response.Body.data = ($response.Body.Data | ConvertFrom-Json)
| ~~~~~~~~~~~~~~~~
| Cannot bind argument to parameter 'InputObject' because it is null.

I am using an application with a role group, and it has permissions...

Can you give me any suggestions?

Thanks!

avatar

Hello,

Can you make certain your Devolution.Server module matches the version of your Devolutions Server? For example, if you have DVLS 2022.3.x, the module needs to be 2022.3.x as well.

If you need access to the older versions of the module, you can get it from PowerShell Gallery. Uninstall the current module and then install the correct version: https://www.powershellgallery.com/packages/Devolutions.server/

Just click on the latest version of the correct major release (2022.2, 2022.1, etc.), and then copy the install module command.

Best regards,

Richard Boisvert

avatar

Thanks Richard, these are my versions:

2022.3.6.0 Devolutions Server version
2022.3.2.1 Devolutions.Server Module

The latest module is up to 2022.3.7.4 (current version) ... are you thinking I should install that now?

Thanks!

avatar

Hello,

Yes, I would recommend updating the module: Update-Module Devolutions.Server

There were several improvements since the two versions. If you still have an issue, what type of authentication are you using? We normally recommend using an application key - https://helpserver.devolutions.net/webinterface_applications.html

You can then use this sample script to connect to the Devolutions Server

$DS_URL= 'https://server/dvls'
$appSecret = 'longkey' 
$appKey = 'key' 

[securestring]$Password = ConvertTo-SecureString $appSecret -AsPlainText -Force
[pscredential]$Credential = New-Object System.Management.Automation.PSCredential ($appKey, $Password)
New-DSSession $Credential $DS_URL -AsApplication


Best regards,

Richard Boisvert