For the complete documentation index, see llms.txt. This page is also available as Markdown.

Esportazione personalizzata in CSV

Molti clienti richiedono un'esportazione speciale che contenga campi specifici.

Ecco un piccolo script che può essere utilizzato per generare gli URL per il nostro nuovo gestore di protocollo web. Generiamo un file csv che contiene il nome e l'URL.


## Get the workspace ID, note that the "Create Web Url" button generates a different ID, but both are accepted.
$dsid = Get-RDM-DataSource | where {$_.IsCurrent -eq "X"} | select -expand "ID"

## Get the RDP sessions, create a new object with the desired fields.

## Simply append "add-member" commands to include a new field.
$s = Get-RDM-Session |
    where {$_.Session.Kind -eq "RDPConfigured"} |
    foreach {
        new-Object Object |
            Add-Member NoteProperty Name $_.Name –PassThru |
          Add-Member NoteProperty URL "rdm://open?DataSource=$dsid&Session=$($_.ID)" –PassThru
};

## Save to csv, the field names are used as column headers.
$s | export-csv c:\temp\sessions.csv -notypeinformation;

Ultimo aggiornamento

È stato utile?