Create enty from tempate

Implemented

Create enty from tempate

avatar

Hi

I'm trying to create a new RPD session from a template, using this:

            $NewRDP = New-RDMSession -TemplateID "157fc699-d152-4c8b-a944-19be44c736e7" -Type RDPConfigured
            $NewRDP.Group = $BaseGroup+"\"+$vm.Name
            Set-RDMSession $NewRDP


Gives this error:

Set-RDMSession : Object reference not set to an instance of an object.
At line:1 char:13
+             Set-RDMSession $NewRDP
+             ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-RDMSession], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,RemoteDesktopManager.PowerShellModule.SetRDMSessionCommand


Regards Lars

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

All Comments (38)

avatar

Hi Lars,

Thank you for reporting this issue.
I'll take a look.

Regards

Jonathan Lafontaine

avatar

Well, apparently, the entry's name isn't mandatory but should be.

$NewRDP = New-RDMSession -TemplateID "157fc699-d152-4c8b-a944-19be44c736e7" -Type RDPConfigured -Name "entry name here"

should fix your issue.

I'll see what I can do to prevent this.

Jonathan Lafontaine

avatar

Hi

Thank you for the update.
To follow the template options, I would argue that it shouldn't be mandatory. If, like I have, the setting is set to keep name, it should honor that. But if that setting isn't set, it should fail with an error that name should be provided.
But thats just my 2 cent :)

I do however not get an error, but it dosn't save either, I use this code:
            try {
                $NewSession = New-RDMSession -Type Group -Name $vm.Name -Host $vm.ComputerName -Group $BaseGroup
                $NewSession.GroupDetails.GroupType = "Server"
                $NewSession.CredentialConnectionID = "1310CF82-6FAB-4B7A-9EEA-3E2E451CA2CF"
                $NewSession.Description = $PrePadding + $vm.Description + $PostPadding
            }
            catch {
                Write-Error "Failed to create varible"
            }
            $ErrorActionPreference = $OldErrorAction
            try {
                Write-Debug "Saving Host entry"
                Set-RDMSession $NewSession
            }
            catch {
                Write-Error "Failed to save to RDM"
            }
            try {
                Write-Debug "Create RDP Connection"
                $NewRDP = New-RDMSession -TemplateID "157fc699-d152-4c8b-a944-19be44c736e7" -Type RDPConfigured -Name "RDP"
                $NewRDP.Group = $BaseGroup+"\"+$vm.Name
            }
            catch {
                Write-Error "Failed to create variable"
            }
            try {
                Write-Debug "Saving to RDM"
                Set-RDMSession $NewRDP -ErrorAction stop | Out-Null
            }
            catch {
                Write-Error "Failed to save to RDM."
            }

/Lars

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

Hi,

How do you validate that nothing has been written?

Jonathan Lafontaine

avatar

I refresh my data in RDM, where content normally shows up instantly.
I have also tried to do a Update-RDMUI, but it still isn't showing in RDM.

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

I tried your script and couldn't replicate your issue.
Your script is valid but something else seems to cause problems.

What data source are your working with?
I tried SQL Server and SQLite

Jonathan Lafontaine

avatar

Newest version of DVLS
And using newest version of RDM

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

Hi

I have actually "found" the entry, The same folder has been created in the account's User vault, and there is the RDP entry.

How do I specify whether the entry should go to main vault or user vault?

/Lars

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

Ah, if you want to save to your user vault, use Set-RDMUserVaultSession

Jonathan Lafontaine

avatar

I don't want to save to the user vault, but for some reason it does save the template entry to the user vault.
It should be created in the main vault.

But thanks for the way to create an entry in User Vault !

/Lars

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

That is... interesting then.
Do you have the folder in your main vault and the folder and entry in the user vault?

Jonathan Lafontaine

avatar

The folder where I create the Server-Folder isn't in the User Vault, but the script has auto-generated it.
The Server-Folder is created in both the main vault and the User vault.
The template session is only created in the user vault.

/Lars

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

I believe on the RDP entry is created in the User Vault.
You probably have virtual folders enabled and since the entry cannot find the folder in the user vault, it will create a temporary one to maintain the entry's hierarchy.

Now we have to figure out why Set-RDMSession saves to your user vault.

Jonathan Lafontaine

avatar

At the moment my PowerShell isn't keen on connecting to DVLS.
When a Get-RDMDataSource gives this:

ID : 0f3bb028-a9ca-4c31-9e66-0a295e0b7855
IsConnected : False
IsOffline : False
Name : My Datasource
Type : RDMS

That is the correct way to make powershell "connect" to the source and "IsConnected" becomes True ?

I'm using Set-RDMCurrentDataSource, and it shows that it seeks authentication. Eventually it thinks it gets it, but the code fails later because it isn't connected.

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

If Get-RDMCurrentDataSource return your DVLS data source and IsConnected is false, something happened.
There are 2 main reasons your data source can not be connected.

  1. License problem. DVLS is an enterprise data source and requires a valide enterprise license. Get-RDMDiagnostic should tell you if your license is valid or not.
  2. Authentication to your data source failed.


Now, RDM way of connecting to DVLS will probably end up prompting you.
For scripting, you could also create an application key in DVLS and associate it to your data source (either through RDM or the PowerShell module). I can explain how to to both. The advantage of using the app key is no prompting, ever while connecting. Also, the app key won't be used by RDM, so your normal authentication method can coexist with the app key in your data source.

Jonathan Lafontaine

avatar

I just did an GET and it connected.
So a SET-RDMCurrentDataSource isn't enough to make it connect?

I have no license issue. License come through valid when querying in Powershell.

Yes, an application key would be awesome. And just to be curtain, if I connect through an application key, can I then be logged into RDM using a user credential,while the PS script still logged-in with the admin cred's key?
If you can send a link to either or both, then that would be awesome! Thanks.

/Lars

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

Set-RDMCurrentDataSource is enough to connect the data source.
However, if for whatever reason it failed, any subsequent command will also try to connect.

And yes, you can have your regular user auth for RDM and the app key for PS configured in the same data source and they won't interfere.
Easiest way is through RDM. Simply edit your data source and fill out the PowerShell section.
forum image

Then Tenant (App) ID and password can be created through the DVLS portal.
In the Administration section, go to Applications
forum image

Use the + sign in the upper right corner to add a new application.
Don't forget to assign users and vaults to the application and copy the password before closing the windows as it won't be available afterward.
Let me know if this is in any way unclear.

Jonathan Lafontaine

avatar

Thanks will try that tomorrow (my time) :)

This will also be my last post, so I can be sleeping before it actually is morning my time :D

This is weird. I just cleaned up everything, from both the main vault and the user vault. Made sure RDM was updated ran the PS Script and now the the entries is created as they should.

But I have had some issues with my templates, because I had defined a group they should be in. This has now been removed, but the path to that folder their were defined, was also in the User Vault, so is cleaned those also.
The Admin's user vault should be empty, and it is now again.
So maybe there were some residue in the template which pointed it to the User vault.

The other weird thing is then, why the template suddenly is present in the User vault, I don't event knew they could be assigned a folder in the user vault.

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

Hi

I have created an Application ID, selected all User Groups and Vaults. I can't select users or anything else.
Under my own datasource I have filled the 2 powershell fields.

When I run the script I get Access denied.

Should I have created a new datasource whith admin credentials? - Or what could I have done wrong?

And I still have issues with connecting:

PS C:\DATA\Repos\CodeRepo> Get-RDMDataSource


ID          : dfe68dbf-522c-45gd-ab5c-873a0a7d1d6f
IsConnected : False
IsOffline   : False
Name        : <<Redacted>>
Type        : RDMS



PS C:\DATA\Repos\CodeRepo> Set-RDMCurrentDataSource -DataSource (Get-RDMDataSource)
PS C:\DATA\Repos\CodeRepo> (Get-RDMCurrentDataSource).IsConnected
False
PS C:\DATA\Repos\CodeRepo> 


Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

What platform are your working on?

Jonathan Lafontaine

avatar

Hi

It is Windows 11 64-bit.
PSVersion: 5.1

/Lars

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

Next step would be to make sure the app id and password are actually there.
You can do so using these commands

$ds = Get-RDMCurrentDataSource #assuming the current data source is your dvls instance
Get-RDMDatasourceProperty $ds -Property "ScriptingTenantID"
Get-RDMDatasourceProperty $ds -Property "ScriptingApplicationPassword"


If they are not the right value or the value is missing, you can set them using these commands

$ds = GetRDMCurrentDataSource
Set-RDMDatasourceProperty $ds -Property "ScriptingTenantID" -Value "id here"
Set-RDMDatasourceProperty $ds -Property "ScriptingApplicationPassword" -Value "app password here"
Set-RDMDataSource $ds

Jonathan Lafontaine

avatar

It is the correct values.

PS C:\DATA\Repos\CodeRepo>  $Currentds = Get-RDMCurrentDataSource

    Set-RDMCurrentDataSource $Currentds

    Get-RDMDatasourceProperty $Currentds -Property "ScriptingTenantID"

    Get-RDMDatasourceProperty $Currentds -Property "ScriptingApplicationPassword"

2aab48ce-97fd-4f46-acf5-f354252736f2

LPr9en7sp8xfgXeplOmyZbbA8jZQIscBlll8dsii7aFsaxIdB1PRRdguPu5h8UtG

PS C:\DATA\Repos\CodeRepo>  (Get-RDMCurrentDataSource).IsConnected
False
PS C:\DATA\Repos\CodeRepo>


Charachers changed, so it's not legitimate key here, but for you to verify if it seams correct to you?

The reason for the "Set-RDMCurrentDataSource $Currentds" is just a second try to hope it connects.
I'm running in VSCode in the "PowerShell Extension"'s PowerShell Integrated Console.

EDIT: I just ran it in a "real" powershell and it gave the same error.

It is a bit confusing that I create an Application key/Application Secret but the RDM asks for a Tenant ID/Password.

Regards Lars


Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

Your app id/password look good.
DVLS logs might have more information as to why your connection is refused.

About the naming.
The first app password we supported called the ID TenantID. We mirrored the name and now we are stuck with it.

Jonathan Lafontaine

avatar

DPS_main got thiese entries after I tried to connect

2022-07-15 15:43:14,072 WARN [88] ?.? - IsTokenValid: Token has expired
2022-07-15 15:43:14,073 WARN [88] ?.? - IsTokenValid: Token has expired
2022-07-15 15:43:14,076 INFO [88] OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+InferEndpointType.HandleAsync - The request address matched a server endpoint: Token.
2022-07-15 15:43:14,077 INFO [88] OpenIddict.Server.OpenIddictServerHandlers+Exchange+ExtractTokenRequest+<HandleAsync>d__5.MoveNext - The token request was successfully extracted: {
  "grant_type": "refresh_token",
  "refresh_token": "[redacted]",
  "client_id": "rdm"
}.
2022-07-15 15:43:14,082 INFO [88] OpenIddict.Server.OpenIddictServerHandlers+Exchange+ValidateTokenRequest+<HandleAsync>d__5.MoveNext - The token request was successfully validated.
2022-07-15 15:43:14,088 INFO [153] OpenIddict.Core.OpenIddictTokenManager`1+<TryRedeemAsync>d__48.MoveNext - The token '43c942af-4456-433e-9bac-b15bcb22feff' was successfully marked as redeemed.
2022-07-15 15:43:14,099 INFO [108] OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ProcessJsonResponse`1+<HandleAsync>d__3.MoveNext - The response was successfully returned as a JSON document: {
  "access_token": "[redacted]",
  "token_type": "Bearer",
  "expires_in": 300,
  "scope": "openid offline_access",
  "id_token": "[redacted]",
  "refresh_token": "[redacted]"
}.
2022-07-15 15:43:27,290 INFO [108] OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+InferEndpointType.HandleAsync - The request address matched a server endpoint: Token.
2022-07-15 15:43:27,291 INFO [108] OpenIddict.Server.OpenIddictServerHandlers+Exchange+ExtractTokenRequest+<HandleAsync>d__5.MoveNext - The token request was successfully extracted: {
  "grant_type": "refresh_token",
  "scope": "openid offline_access",
  "refresh_token": "[redacted]",
  "client_id": "dvls",
  "clientVersion": "2022.2.6.0",
  "platform": "Web"
}.
2022-07-15 15:43:27,295 INFO [108] OpenIddict.Server.OpenIddictServerHandlers+Exchange+ValidateTokenRequest+<HandleAsync>d__5.MoveNext - The token request was successfully validated.
2022-07-15 15:43:27,298 INFO [108] OpenIddict.Core.OpenIddictTokenManager`1+<TryRedeemAsync>d__48.MoveNext - The token 'bc719f0f-b8a1-4bd1-9bbe-76e0af8e885c' was successfully marked as redeemed.
2022-07-15 15:43:27,308 INFO [108] OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ProcessJsonResponse`1+<HandleAsync>d__3.MoveNext - The response was successfully returned as a JSON document: {
  "access_token": "[redacted]",
  "token_type": "Bearer",
  "expires_in": 300,
  "id_token": "[redacted]",
  "refresh_token": "[redacted]"
}.
2022-07-15 15:43:33,345 INFO [108] OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+InferEndpointType.HandleAsync - The request address matched a server endpoint: Token.
2022-07-15 15:43:33,345 INFO [108] OpenIddict.Server.OpenIddictServerHandlers+Exchange+ExtractTokenRequest+<HandleAsync>d__5.MoveNext - The token request was successfully extracted: {
  "grant_type": "refresh_token",
  "scope": "openid offline_access",
  "refresh_token": "[redacted]",
  "client_id": "dvls",
  "clientVersion": "2022.2.6.0",
  "platform": "Web"
}.
2022-07-15 15:43:33,350 INFO [108] OpenIddict.Server.OpenIddictServerHandlers+Exchange+ValidateTokenRequest+<HandleAsync>d__5.MoveNext - The token request was successfully validated.
2022-07-15 15:43:33,354 INFO [108] OpenIddict.Core.OpenIddictTokenManager`1+<TryRedeemAsync>d__48.MoveNext - The token '4522cc0d-0da2-4403-a6fb-53e135069025' was successfully marked as redeemed.
2022-07-15 15:43:33,364 INFO [113] OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ProcessJsonResponse`1+<HandleAsync>d__3.MoveNext - The response was successfully returned as a JSON document: {
  "access_token": "[redacted]",
  "token_type": "Bearer",
  "expires_in": 300,
  "id_token": "[redacted]",
  "refresh_token": "[redacted]"
}.


Besides the first log seams bad, I guess that the other entries is making up for it?
BUT other people are also using this, so it could be from other connections.

What platform is scrpts tagged as?

/Lars

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

When using app id/password the client will be "scripting" and the platform will be whatever platform you are running PS from.
Windows in your case.

Jonathan Lafontaine

avatar

Hi

To make my script more compatible, I have changed to I provide the key/password ino the script, only in the "CurrentRDMDataSource".
I then ran the script, and it ran without error.
Only problem, Server-Folder created in both Shared vault and Private vault, and only RDP sessions in the private vault.

I then deleted all folder, ran the script again and now I get Access Denied.

In my DVLS Settings I have disabled scripting access as default. Created a group and given that group access to "Application" scripting, and of cause put my user in that group.
Shouldn't that work?

To get further, I added a new datasource with Admin credentials, and ran the script again. It creates the folders, but not the RDP connection.

Here is the complete script part I use to create the folder and RDP connection:

if ($VM.name -like "SLOT-[0-9][0-9][0-9]" -or $VM.Name -like "VM-[0-9][0-9]" -or $VM.name -like "NP-[0-9][0-9]" -or $VM.name -like "SP-[0-9][0-9]") {
                    Write-Verbose "Booking slot, skipping"
                    Continue
                }
                Write-Verbose "Entry not found, creating: $($VM.Name)"
                try {
                    $DefaultInfo = 'HOST: $HOST$
                    IP: $COMPUTER_IP$'
                    $NewSession = New-RDMSession -Type Group -Name $VM.Name -Host $VM.ComputerName -Group $BaseGroup
                    $NewSession.GroupDetails.GroupType = "Server"
                    $NewSession.CredentialConnectionID = "1310CF82-6FAB-4B7A-9EEA-3E2E451CA2CF"
                    $NewSession.Description = $DefaultInfo + $PrePadding + $VM.Description + $PostPadding
                }
                catch {
                    Write-Error "Failed to create varible $_"
                }
                try {
                    Write-Verbose "Saving Host entry"
                    Set-RDMSession $NewSession
                }
                catch {
                    Write-Error "Failed to save to RDM"
                }
                try {
                   Write-Verbose "Create RDP Connection"
                    $UseTemplate = $False
                    if ($UseTemplate -eq $True) {
                        $NewRDP = New-RDMSession -Type RDPConfigured -Name "RDP" -TemplateID "157fc699-d152-4c8b-a944-19be44c736e7"
                        $NewRDP.Group = $NewSession.Group
                    }else{
                        $NewRDP = New-RDMSession -Type RDPConfigured -Name "RDP"
                        $NewRDP.TemplateName = "RDP"
                        $NewRDP.Group = $NewSession.Group
                        $NewRDP.UsesHardDrives = $False
                        $NewRDP.AuthentificationLevel = "ConnectDontWarnMe"
                        $NewRDP.SoundHook = "BringToThisComputer"
                        $NewRDP.AlternateHostMode = "PortScan"
                        $NewRDP.DisplayMonitor = "Primary"
                        $NewRDP.HostSourceMode = "Inherited"
                        $NewRDP.KeyboardHook = "OnTheRemoteComputer"
                        $NewRDP.AlternateHosts = '$COMPUTER_IP$'
                        $NewRDP.CredentialConnectionID = "1310CF82-6FAB-4B7A-9EEA-3E2E451CA2CF"
                        $NewRDP.TabTitle = '$COMPUTER_HOST$'
                    }
                }
                catch {
                    Write-Error "Failed to create RDP Connection"
                }
                try {
                    Write-Verbose "Saving RDP Connection"
                    Set-RDMSession $NewRDP
                }
                catch {
                    Write-Error "Failed to save RDP Connection"
                }
                Write-Information "Creation done."


When running the above script manually and printing the content of $NewRDP it outputs this:

DocumentData                              :
HostResolved                              :
PsPlaylistLocal                           :
SubConnections                            : {}
UserSpecficSettings                       :
AlwaysAskForResources                     : False
AutoReconnection                          : True
CommandLineWaitForApplicationToExit       : False
Console                                   : False
DesktopComposition                        : False
DisableBitmapCache                        : False
DisableCursorSetting                      : False
DisableFullWindowDrag                     : False
DisableMenuAnims                          : False
DisableThemes                             : False
DisableWallpaper                          : False
DisplayConnectionBar                      : True
FontSmoothing                             : False
Span                                      : False
UsesClipboard                             : True
UsesDevices                               : False
UsesHardDrives                            : False
UsesPrinters                              : False
UsesSerialPorts                           : False
UsesSmartDevices                          : False
AllowClipboard                            : False
AllowPasswordVariable                     : False
AllowViewPasswordAction                   : False
AlternalteHostVPNBefore                   : False
AlternateHostAllowCustomHost              : False
AutomaticallyClose                        : False
ConfluenceIgnoreCertificateAuthentication : False
ConfluenceIgnoreCertificateErrors         : False
DomainHostOverride                        : False
Encrypt                                   : False
ExcludeFromNotifications                  : False
ExludeFromOpenedSession                   : False
GoOfflineOnConnect                        : False
IncludeInFavorite                         : False
OpenEmbedded                              : True
PromptCredentials                         : False
SharedTemplate                            : False
ShowInTrayIcon                            : True
Undocked                                  : False
UseVPN                                    : False
Image                                     :
TemplateGroupData                         :
ApplicationIntegrationMode                : Default
AuthentificationLevel                     : ConnectDontWarnMe
ScreenColor                               : C32Bits
ScreenSize                                : Default
SoundHook                                 : BringToThisComputer
WebBrowserApplication                     : Default
AlternateHostMode                         : PortScan
ColorMode                                 : Custom
ConnectionStringMode                      : Default
ConnectionType                            : RDPConfigured
CredentialInheritedMode                   : Default
DescriptionMode                           : Text
DisplayMonitor                            : Primary
DisplayVirtualDesktop                     : Current
DomainOverrideType                        : Default
ForeColorStyle                            : Status
HostSourceMode                            : Inherited
IntelligentCacheAction                    : AddUpdate
KeyboardHook                              : OnTheRemoteComputer
PinEmbeddedMode                           : Default
PingConnectionMethod                      : Default
PingConnectionMode                        : Default
ReconnectMode                             : Default
RiskyEvents                               : Default
ShowDocumentationTab                      : Inherited
TabGroupMode                              : Custom
TemplateSearchPathMode                    : None
UndockMaximized                           : Default
UserNameFormat                            : Default
Visibility                                : Default
AutomaticallyCloseInterval                : 0
HostPort                                  : 3389
PingConnectionScanPort                    : 0
SortPriority                              : 0
SubMode                                   : 0
WakeOnLANPort                             : 0
ID                                        : 733651ac-af19-467a-83b2-b9b0567b6e1a
SecurityGroup                             : 00000000-0000-0000-0000-000000000000
UserVaultMigrationID                      : 00000000-0000-0000-0000-000000000000
AlternateShell                            :
CommandLine                               :
CommandLineWorkingDirectory               :
RDPFileName                               :
ShellWorkingDirectory                     :
Url                                       :
WebBrowserUrl                             :
AlternateHosts                            : $COMPUTER_IP$
ClearTextPassword                         :
ClearTextPrivateKeyData                   :
Color                                     :
ConfluenceDocumentationUrl                :
ConnectionStringConnectionID              :
ConnectionSubType                         :
CreatedBy                                 : vilhen
CreationSource                            :
CredentialConnectionGroup                 :
CredentialConnectionID                    : 1310CF82-6FAB-4B7A-9EEA-3E2E451CA2CF
CredentialConnectionSavedPath             :
CredentialDynamicDescription              :
CredentialDynamicValue                    :
CredentialPrivateVaultSearchString        :
CustomDnsServer                           :
CustomPort                                :
CustomStatus                              :
Data                                      :
DataFileName                              :
Description                               :
DescriptionRtf                            :
DescriptionUrl                            :
DocumentationTitle                        :
DocumentLinkConnectionID                  :
ForeColor                                 :
Group                                     : .Vitec Aloc AS\TEKSUP\aloc.com\NewVMs\SLOT-780
GroupCredentialPrompt                     :
GroupTab                                  :
Host                                      :
HostConnectionID                          :
HostConnectionSavedPath                   :
HostDomain                                :
HostFull                                  :
HostNetworkInterfaceMac                   : en0
HostUserName                              :
HostWithPort                              :
ImageMD5                                  :
ImageName                                 :
Name                                      : RDP
PamCredentialID                           :
PamCredentialName                         :
PersonalConnectionID                      :
PrivateKeyConnectionID                    :
PrivateKeySearchString                    :
RepositoryID                              : 00000000-0000-0000-0000-000000000000
Stamp                                     : f65a2c43-8cb1-425c-8aff-d7cdeefe9705
Status                                    :
StatusLockedBy                            :
StatusMessage                             :
SwitchDataSourceID                        :
SwitchDataSourceName                      :
SwitchRepositoryFolder                    :
SwitchRepositoryID                        :
SwitchRepositoryName                      :
TabTitle                                  : $COMPUTER_HOST$
TemplateName                              : RDP
TemplateSearchPath                        :
TemplateSecurityGroup                     :
TemplateSourceID                          : 63f23e45-8e77-4bc0-ae2b-8c51e4433634
UpdatedBy                                 :
WakeOnLANBroadcastIPAddress               :
VNCOptions                                :
VNCUrl                                    :
VPNDomain                                 :
VPNName                                   :
VPNSafePassword                           :
VPNUserName                               :
CreationDateTime                          : 18-07-2022 11:44:18
UpdateDateTime                            :
ActiveDirectoryConsole                    : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSActiveDirectoryConsoleConnection
AddOn                                     : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSAddOnConnection
Agent                                     : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSAgentConnection
Autofill                                  : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSAutofillConnection
Aws                                       : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSAwsConnection
Azure                                     : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSAzureConsoleConnection
AzureStorage                              : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSAzureStorageConnection
BeyondTrustPasswordSafeConsole            : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSBeyondTrustPasswordSafeConsoleConnection
BoxNet                                    : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSBoxNetConnection
ChromeRemoteDesktop                       : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSChromeRemoteDesktopConnection
Citrix                                    : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSCitrixConnection
CloudBerryRemoteAssistant                 : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSCloudBerryRemoteAssistantConnection
Cmd                                       : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSCmdConnection
ControlUp                                 : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSControlUpConnection
Credentials                               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSCredentialsConnection
Customer                                  : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSCustomerConnection
CyberArkDashboard                         : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSCyberArkDashboardConnection
DvlsPamDashboard                          : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDVLSPamDashboardConnection
CyberArkPSM                               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSCyberArkPSMConnection
Dameware                                  : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDamewareConnection
DataEntry                                 : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDataEntryConnection
DataReport                                : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDataReportConnection
DeskRoll                                  : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDeskRollConnection
DevolutionsGateway                        : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDevolutionsGatewayConnection
Document                                  : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDocumentConnection
DropBox                                   : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDropBoxConnection
Events                                    : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSConnectionEvents
FileExplorer                              : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSFileExplorerConnection
Ftp                                       : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSFtpConnection
GoogleCloud                               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSGoogleCloudConnection
GoogleDrive                               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSGoogleDriveConnection
GotoAssist                                : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSGoToAssistConnection
GroupDetails                              : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSGroupConnection
HostDetails                               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSHostConnection
Hub                                       : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSHubConnection
HyperV                                    : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSHyperVConnection
IDrac                                     : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSIDracConnection
ILO                                       : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSILOConnection
Intel                                     : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSIntelConnection
InventoryReport                           : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSInventoryReportConnection
ITerm                                     : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSITermConnection
Jump                                      : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSJumpConnection
JumpCommand                               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSJumpCommand
JumpDesktop                               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSJumpDesktopConnection
LogMeIn                                   : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSLogMeInConnection
MetaInformation                           : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSConnectionMetaInformation
OTP                                       : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSConnectionOTP
PlayList                                  : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSPlayListConnection
PowerShell                                : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSPowerShellConnection
ProxyTunnel                               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSProxyTunnelConnection
ProxyTunnelMac                            : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSProxyTunnelConnectionMac
Putty                                     : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSPuttyConnection
Radmin                                    : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRadminConnection
RDCommander                               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRDCommanderConnection
RDGateway                                 : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRDGatewayConnection
RDP                                       : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRDPConnection
Recording                                 : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRecordingConnection
RemoteAssistance                          : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRemoteAssistanceConnection
ReportTool                                : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSReportToolConnection
Root                                      : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRootConnection
RunAsConnection                           : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRunAsConnection
S3                                        : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSS3Connection
Scp                                       : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSScpConnection
Script                                    : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSScriptConnection
Security                                  : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSSecurityConnection
Shortcut                                  : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSShortcutConnection
SkyDrive                                  : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSSkyDriveConnection
SmartFolder                               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSSmartFolderConnection
SNMPReport                                : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSSNMPReportConnection
Spiceworks                                : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSSpiceworksConnection
Splunk                                    : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSSplunkConnection
Stats                                     : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSStatsConnection
Sync                                      : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSSyncConnection
TeamViewer                                : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSTeamViewerConnection
TeamViewerConsole                         : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSTeamViewerConsoleConnection
Template                                  : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSTemplateConnection
Terminal                                  : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSTerminalConnection
TerminalConsole                           : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSTerminalServerConnection
TerminalMac                               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSTerminalConnectionMac
Tools                                     : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSToolConnection
VirtualBox                                : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSVirtualBoxConnection
VMRC                                      : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSVMRCConnection
VMWare                                    : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSVMWareConnection
VNC                                       : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSVNCConnection
VPN                                       : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSVPNConnection
VPNMac                                    : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSVPNConnectionMac
Web                                       : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWebConnection
WebDav                                    : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWebDavConnection
WindowsAdminCenter                        : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWindowsAdminCenterConnection
XenServer                                 : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSXenServerConnection
XWindow                                   : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSXWindowConnection


Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

I have tried to create the RDP Connection manually, with exact same settings.
And outputting $NewRDP to at txt, where $NewRDP is created manually and with template, and then comparing the two txt files and the only difference in the rwo files is in:

ID
Stamp
TemplateSourceID

Which is good, otherwise I think there would be a problem :D

But the Template created don't show in RDM, and I don't get an error in PowerShell.
The Manually created entry is created and shown i RDM.

I have updateded the code to reflect the manual creation option.

And added the two txt files I compare.

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

NewTemplateRDP.txt

NewManualRDP.txt

avatar

Powershell Module version:

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Binary     2022.2.0.0 RemoteDesktopManager                {Add-RDMPrivateSessionAttachment, Add-RDMRoleRepositoryAccess, Add-RDMRoleToUser, Add-RDMSessionAttachment...}


Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

In regards to the connection unstability:
I was just trying to execute the script on the DVLS server, where I explect it to run scheduled, and there I get

InvalidUserNameOrPasswordPleaseVerifyYourCredentials
InvalidUserNameOrPasswordPleaseVerifyYourCredentials


When the script runs the command:

$DataSources = Get-RDMDataSource

And the "IsConnected" is false.

It aslo seems like I have to close the powershell session and open a new before it actually tries to connect again.

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

How was your template created?
I just want to make sure I'm testing with a setup as close as yours.

Jonathan Lafontaine

avatar

Uhh, not sure. But I think this one have been created from the web interface, and then I found that I couldn’t change setting from web, and then I changed the settings from RDM afterwards.

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

I was able to reproduce your session not showing up issue.
I'm working on it.

Jonathan Lafontaine

avatar

One thing tho.
When creating the RDP session from a template, you do not specify a host.
Currently, New-RDMSession will always overwrite the Name and Host with the provided switch value. If no host is given, the connection.Host will be set to null.
Calling Set-RDMSession with a session with a null host results in an warning message and no session saved.

WARNING: Unable to save the entry; invalid data sent

Property HostName value cannot be empty

Does it help if you set a host after calling New-RDMSession ?

Jonathan Lafontaine

avatar

Hi

I do not get the error though :)

But yes adding:

-Host ""

The entry is created.

So the Powershell module should have a ParameterSet that Name and Host is required if TemplateID is used.

Thank you for your assistance!

Regards Lars

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

Either that or we don't overwrite the Host and Name of the entry if none were past on the command line.
Does your template specify a host?

Jonathan Lafontaine

avatar

No, I have not specified a host, as the host is set to inherit.

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------

avatar

Hi

Just FYI as my original issue is resolved but I still have issues with the connection I will start a new thread regarding that issue.

Regards Lars

Remote Desktop Manager connected with Devolutions Server running newest versions.

------------------------Signature------------------------

Sorry if any of above sounds harsh or provoking, it is NOT meant as such, but I have Asperger's and don't always know.
My intentions is always to be friendly.

-------------------------------------------------------------