Create Random Password from Template without RDM installed

Create Random Password from Template without RDM installed

avatar

Hi,

I just want to create a random password using the template defined in our Devolutions-Server. (and use this for updating DS-Server entries later)

This works on my PC (where RDM is installed) with this command: New-RDMRandomPassword -TemplateName 'TemplateName'

It does not work on a server without RDM installation, as I do not have access to the Template respectively the Datasource/Devolutions-Server where the template is defined.

Therefore I tried connecting to the Datasource/Devolutions-Server in order to access the template with the following command from this post: https://forum.devolutions.net/topics/39564/using-powershell-to-update-an-existing-password-entry#177308

$ds_url = ''
$appSecret = ''
$appKey = ''
$ds = New-RDMDataSource -DVLS -Name $dataSourceName -Server $ds_url -ScriptingTenantID $appKey -ScriptingApplicationPassword $appSecret -SetDataSource

I receive the following error: [Error] The operation was canceled.

Is this because I do not have RDM installed? On my PC this command works.

I mean it would make sense as 'New-RDMDataSource' is a RDM command, but as I just want to generate a password using the template, it would be better if I would not need to install RDM on the server I want to run this command.

Would that even be the correct way of doing this or is there another "non RDM-ish" Command for generating a random Password with DS-Server template?

*I have devolutions.powershell.2023.3.1 Module installed.

All Comments (7)

avatar

Hello,

With the Devolutions.PowerShell module, there is no need to have RDM installed.

Usually, the module should create a folder under %localappdata%\Devolutions\RemoteDesktopManager. Do you see that folder with files that have been created on that machine?

Please run the Get-RDMInstance cmdlet to get the configuration folder where the files should be created.

About the DS cmdlets, I don't see any that could use an existing password template to generate a password.

I will try to reproduce your issue.

Best regards,

Érica Poirier

avatar

%localappdata%\Devolutions\RemoteDesktopManager is existing but is empty

Get-RDMInstance throws an error:

PS C:\Users\Administrator> Get-RDMInstance
DllNotFoundException - Unable to load DLL 'sqlite3secure' or one of its dependencies: The specified module could not be found. (0x8007007E)

   at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none_other(SQLiteConfigOpsEnum op)
   at System.Data.SQLite.UnsafeNativeMethods.Sqlite3_Config_None(SQLiteConfigOpsEnum op)
   at System.Data.SQLite.SQLite3.StaticIsInitialized()
   at System.Data.SQLite.SQLiteLog.Initialize()
   at System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework)
   at System.Data.SQLite.SQLiteConnection..ctor(String connectionString)
   at Devolutions.RemoteDesktopManager.Business.DataSources.SQLiteConnectionDataSource.CreateDbConnection(String connectionString)
   at Devolutions.RemoteDesktopManager.Business.DataSources.DatabaseConnectionDataSource.CreateDbConnection(Boolean master, Nullable`1 connectTimeout)
   at Devolutions.RemoteDesktopManager.Business.DataSources.DatabaseConnectionDataSource.CreateDbConnection(Nullable`1 connectTimeout)
   at Devolutions.RemoteDesktopManager.Business.DataSources.SqLiteUpdater.FetchDatabaseVersion()
   at Devolutions.RemoteDesktopManager.Business.DataSources.DatabaseUpdater.RefreshVersionNumber()
   at Devolutions.RemoteDesktopManager.Business.DataSources.DatabaseUpdater.get_DatabaseVersion()
   at Devolutions.RemoteDesktopManager.Business.DataSources.DatabaseUpdater.get_IsUpgradeRequired()
   at Devolutions.RemoteDesktopManager.Managers.DataSourceManager.IsDatabaseUpgradeRequired(BaseConnectionDataSource dataSource)
   at Devolutions.RemoteDesktopManager.Managers.DataSourceManager.UpgradeDatabase(BaseConnectionDataSource dataSource)
   at Devolutions.RemoteDesktopManager.Services.DataSourceService.UpgradeDatabase(BaseConnectionDataSource dataSource)
   at Devolutions.RemoteDesktopManager.Managers.DataSourceManager.UpgradeDatabase(BaseConnectionDataSource dataSource)
   at Devolutions.RemoteDesktopManager.Managers.ConnectionManager.LoadConnectionsFromDataSource(ConnectionEngine engine, Boolean hasChanged)
   at Devolutions.RemoteDesktopManager.Managers.ConnectionManager.LoadConnections(BaseConnectionDataSource dataSource)

ApplicationVersion OptionFilename
------------------ --------------
2023.3.1.0         C:\Users\Administrator\AppData\Roaming\Devolutions\RemoteDesktopManager\RemoteDesktopManager.cfg


I installed the module manually, as I do not have internet on that server, if that may caused the issue.

avatar

I just installed the module manually on a fresh server.

Also an error when running Get-RDMInstance:

PS C:\Users\Administrator> Get-RDMInstance
WARNING: Unable to create database.

Unable to load DLL 'sqlite3secure' or one of its dependencies: The specified module could not be found. (0x8007007E)

ApplicationVersion OptionFilename
------------------ --------------
2023.3.1.0         C:\Users\Administrator\AppData\Roaming\Devolutions\RemoteDesktopManager\RemoteDesktopManager.cfg


I will try the newer version of the module and also try installing it by Install-Module -Name Devolutions.PowerShell Command.

avatar

Automatic installation via Install-Module command worked, no error on Get-RDMInstance Command.

When I initially ran Get-RDMInstance, I saw something was loading, I assume that something has been downloaded/installed. Maybe I need to find a way to offline install this dependency of DLL 'sqlite3secure'

avatar

Hello,

Thank you for your feedback.

Do you still get an error when creating the DVLS data source using this automatically installed module?

Best regards,

Érica Poirier

avatar

Yes same error: "[Error] The operation was canceled." - so the issue isn't (just) caused by this sqlite3secure dependency.

However you mentioned with the Devolutions.PowerShell module, there is no need to have RDM installed.
But I just installed RDM and after that creating DVLS data source did actually work and I was able to use my password template.

avatar

Hello,

Thank you for your feedback.

For the error "[Error] The operation was canceled.", you can ignore it. The cmdlet tries to update the UI but there is no UI! So you can still use the data source even with that error.

For the missing dll file, you can refer to this thread. Then, you will only need to get the Microsoft Visual c++ 2015-2022 (version 14).

Let us know if that helps.

Best regards,

Érica Poirier