Automatic import of credentials via Powershell into Customer Folders

Automatic import of credentials via Powershell into Customer Folders

avatar

Hey there

We have an SQL Database with credentials (Just User/Password or User/Password/Website URL) which we want to import into a credential or website entry in the Devolutions Server.

  1. What is the script to get this data out of SQL and import it into de D-Server via Powershell
  2. We want to search the import for the company Customer Number, and import the Credentials Entries in a subfolder of this customer. For Example, all entries with CustomerID: 1035 in the SQL Database, should all be imported in D-Server under the Folder: Customer Name [1035] \Credentials
  3. This import should run periodically, as new entries can be made in the Database, or also some entries could be changed (new passwords) so they should be overwritten with every new import


Is this possible and how could this be done?

Thanks a lot.
Patrick

All Comments (3)

avatar

Hello,

Thank you for contact us on that matter.

It is possible to create a PowerShell script that will manage 2 different data sources, one connected to SQL and the other one connected to DVLS. Then your script can fetch entries from a customer ID using Get-RDMSession cmdlet and export the entries in a CSV file. Then, the script switch to the DVLS data source and import the entries one by one from the CSV file. It should verify if the entry exists to know if it's a new entry or if the script need to update an existing entry.

Here is a sample of the Get-RDMSession cmdlet to filter the entries for a specific customer.

$session = Get-RDMSession | where {$_.Name.Contains("1035")}


Let us know if you have further questions about this.

Best regards,

Érica Poirier

avatar

Hello Erica

Thank you very much. Could you post an example power she'll script for the import to the DVLS Server from the csv? That would be very helpful.

Thanks a lot.
Patrick

avatar

Hello Patrick,

Thank you for your feedback.

You should find what you are looking for in the following script.
https://github.com/Devolutions/RDMSamples-ps/blob/main/module/import/DevolutionsCSVImport.ps1

Let me know if you have further questions.

Best regards,

Érica Poirier