Weekly Scripted Export/Backup

Weekly Scripted Export/Backup

avatar

I am trying to work out the best way to export the data from Remote Desktop Manager on a automated bases, so we can store an encrypted version offsite of all our passwords.
I can export the data in password protected ZIP file or encrypted HTML within the gui, but I would like to automate it, and I would appreciate anyone that can offer some help on this?
We are currently using SQL server to store the data, and I can automate the backup of the SQL database but that is not encrypted and I would like the data in type that can be accessed without a server or any application like SQL server, so a ZIP or HTML file is perfect for this, any help or alternative advise is more than welcome.


Thanks
Martin

All Comments (4)

avatar

Hello,

The script will be outside of RDM, and you must use some other tool to schedule its execution.

You must adapt the paths to your own environment!

$YourRDMModule = 'D:\Tools\Devolutions\LastRDM\RemoteDesktopManager.PowerShellModule.psd1'
$ExportFileName = 'D:\Bak\RdmData.xml'
If ( ! (Get-module RemoteDesktopManager.PowerShellModule )) {
Import-Module $YourRDMModule
}
#the next call is for display purposes, I would grab the output of the script in a log file
Get-RDMCurrentDatasource
#if you have multiple data sources, you must use something like
#Set-RDMCurrentDataSource -ID '{YOUR DATA SOURCE ID}' -Username $userName -Password $userPassword
$sessions = Get-RDMSession;
#now we enforce using a password to protect the exported file
#since this script would typically be scheduled, we are providing the password as is
#there are multiple ways to get a password from a profile without hard-coding it
#in a script.
$exportPwd = "123456"
$pass = ConvertTo-SecureString $exportPwd -asplaintext -force;
#Now on to the export, the only format that can be imported back in RDM is XML!
Export-RDMSession -Path $ExportFileName -Sessions $sessions -XML -Password $pass -IncludeCredentials
We intend to improve this, maybe even offer a function library that would contain an improved version of this.

Just let us know if there is an issue with this.


Best regards,

Maurice

avatar

Is there a way to export to CSV/XML where the passwords are clear-text?

I see that even if I use the options
$sessions | export-csv c:\temp\sessions.csv 
or
Export-RDMSession -Path $ExportFileName -Sessions $sessions -XML -IncludeCredentials (with no passwords)

The passwords in the CSV don't exist, and in the XML they are encrypted.

avatar

Hello,

It is possible if your create your own script that will export session by session and add each session as a new line to your CSV file.

To be able to export the passwords for credential entries or even any session type, you will have to use the Get-RDMSessionPassword cmdlet to first decrypt them.

Let me know if you have any other questions about it.

Best regards,

Érica Poirier

avatar

Hello Reuvens,

I will send you a private message with a script to export to CSV with passwords as clear text.

Best regards,

Richard Boisvert