Set-RDM-Datasource;Xml data source initialization

Set-RDM-Datasource;Xml data source initialization

avatar
marg
Disabled

Hi.

I got a problem while importing some sessions into the RDM via Powershell.

I have 2 Datasources:

"Local Data Source" and "RDMconnects"

Before i can import the sessions, i need to change the Datasource to "RDMconnects" because the

Local Data Source is always current.

For that i will use: Set-RDM-DataSource -ID

So, now the problem.

Everytime i run the script i get a PopUp "Xml data source initialization - Configure your security settings" >> see attachment..

I want to use that script in a GUI and want to get rid of this, so just set the RDMconnects data source.

Is there a way to avoid that PopUp?

Thank you!

All Comments (7)

avatar

You need to initialize the "Local Data Source" once done the prompt will no longer be displayed.

Now if you don't use this data source you can simply deleted it.

Stéfane Lavergne

avatar
marg
Disabled

The problem is, i want to provide that script to several users.

They only choose the clients and servers to import at the GUI and the script will do that for them.

some of them use the local data source, so deleting it is unfortunately no solution.

And to tell everyone of them to initialize it once, before they can use the script, is not the way i prefer tbh..

Is there no other way to make it invisible or something else?

thanks..

avatar

I see your dilemma, I will see what we can do.

Stéfane Lavergne

avatar

Fixed internally, it will be available in the next release.

What is does is if ever you open an Xml data source in PowerShell for the very first time then it simply chooses the default master key without prompting the user (no UI).

It would then be up to the user to go change the master key at a later date through RDM for that data source.

I hope that resolves your issue adequately?

Stéfane Lavergne

avatar
marg
Disabled

Hello, nice to hear that it is in the next release!

What do you mean with that:

"What is does is if ever you open an Xml data source in PowerShell for the very first time then it simply chooses the default master key without prompting the user (no UI)."

I can't see what you mean, sorry.

BTW, when i import a few sessions (around 30).

I first read the Hostname and so on from a .csv File and then create a new session and set the properties..

Until all of them are imported it needs a few minutes (~5min)

If i import a .rdm-File through "file - import - import session list" it only needs a few seconds.

Is there something i do wrong?

Code:

$session = New-RDM-Session -Name $Name -Host $MachineName -Kind "RDPConfigured"

Set-RDM-Session $session

$list = $session

Set-RDM-Property -ID $list.ID -Property "Group" -Value $Group

Set-RDM-Property -ID $list.ID -Path "MetaInformation" -Property "OS" -Value $OS

Set-RDM-Property -ID $list.ID -Path "RDP" -Property "Domain" -Value $Domain

Set-RDM-Property -ID $list.ID -Path "RDP" -Property "UserName" -Value $UserName

Set-RDM-Property -ID $list.ID -Property "Url" -Value $MachineName

Set-RDM-Property -ID $list.ID -Property "Domain" -Value $Domain

Set-RDM-Property -ID $list.ID -Property "UserName" -Value $UserName

Thanks for your support :)

avatar

Xml data sources must be initialized prior to accessing it’s properties or create a session. This is done via the “Xml data source initialization” window. If this situation happens in PowerShell mode then the user is not prompt instead the system will automatically select the default master key.

As for the speed issues using the –NoRefesh option on the Set CmdLets will speed up the process.

Something like:

$session = New-RDM-Session -Name $Name -Host $MachineName -Kind "RDPConfigured"

$session.Group = $Group

$session.MetaInformation.OS = $OS

Set-RDM-Session $session -NoRefresh

Set-RDM-Domain -ID $session.ID -Domain $Domain -NoRefresh

Set-RDM-UserName -ID $session.ID -UserName $UserName

Now you will notice a few changes

  • Some properties (Group & MetaInformation.OS) can be assigned directly. Why? Since, in the case of a "New", $session has a reference to the actual session object so we can directly set its properties (much faster). This is not the case of sessions given out by Get-RDM-Session which returns a proxy to the session object for security reasons.

  • call Set-RDM-Session with no refresh

  • Setting Domain, UserName & Password must be done via their respective CmdLet since they are handled differently than any other property (again for security reasons)

  • On the last Set, I don’t have the –NoRefresh this will cause the UI to refresh, once only, if you don't care to refresh the UI, add -NoRefresh

  • I’ve removed the set of the Url property, since in RDP it maps to the Host Name which is already set by the New-RDM-Session –Host property

Stéfane Lavergne

avatar
marg
Disabled

Hey..

Wow, it's much faster now, the only thing that doesn't work you wrote:

$session.MetaInformation.OS = $OS

i did it like the examples below with set property -norefresh, and then it worked.

but thank you for your help, amazing support :)