Quantcast
Channel: Devolutions Forum - Recent Posts
Viewing all articles
Browse latest Browse all 19717

Topic "Custom export to CSV" a message from Maurice Cote

$
0
0
Hi all

Many customers ask for a special export that would contain specific fields. Here is a small script that can be used to generate URLs for our new web protocol handler. We generate a csv file that contains the name and the URL.

## get the data source ID, note that the &quotCreate Web Url&quot button generates a different ID, but both are accepted
$dsid = Get-RDM-DataSource | where {$_.IsCurrent -eq &quotX&quot} | select -expand &quotID&quot
## get the RDP sessions, create a new object with the desired fields.
## Simply append &quotadd-member&quot commands to include a new field
$s = Get-RDM-Session |
where {$_.Session.Kind -eq &quotRDPConfigured&quot} |
foreach {
new-Object Object |
Add-Member NoteProperty Name $_.Name –PassThru |
Add-Member NoteProperty URL &quotrdm://open?DataSource=$dsid&Session=$($_.ID)&quot –PassThru
};
## save to csv, the field names are used as column headers.
$s | export-csv c:\temp\sessions.csv -notypeinformation;

edited by mcote on 7/4/2014

Viewing all articles
Browse latest Browse all 19717

Trending Articles