Hi,
currently I would like to change a few properties on a new sessions I create (type Folder and Credentials but I guess these kind of properties apply to all sessions):
Best regards,
Rok
Hello RokB,
I am unable to set the properties for the icon and icon color using the RDM cmdlet, they seem to be read-only. I will verify with my colleagues and get back to you.
Best regards,
Richard Boisvert
Hello RokB,
To change only the color, you can use the following. Refer to the last code block for more details and comments.
You will need to replace the SessionID with the Session ID and colorname with one of the following : Black - Blue - Forest - Grey - Orange - Royal - Yellow - Purple - Black - Red - Green . Note that it needs to be inserted between brackets [ ].
$RDMsession = Get-RDMSession | Where-Object {$_.id -eq "SessionID"}
$RDMSession.ImageName = "[colorname]"
Set-RDMSession -Session $RDMsession
Update-RDMUI
To change the icon to one of the images, you can use the code below. You will need to change the sessionID and the changename
$RDMsession = Get-RDMSession | Where-Object {$_.id -eq "SessionID"}
$RDMSession.ImageName = "SamplechangeName"
Set-RDMSession -Session $RDMsession
Update-RDMUI
Note that for the image name, you need to put Sample first and then the name of the icon followed by the color. For example, if you want the FlagGreen, you need to put "SampleFlagGreen". The name of the icons are available in RDM.
I also created functions for you:
#Verify if the RDM PS module is loaded, if not, import it
if ( ! (Get-module RemoteDesktopManager.PowerShellModule )) {
Import-Module "${env:ProgramFiles(x86)}\Devolutions\Remote Desktop Manager\RemoteDesktopManager.PowerShellModule.psd1"
}
function Set-RDMDefaultSessionColor {
<#
.SYNOPSIS
Set the color of an entry in RDM
.DESCRIPTION
This function sets the color of a folder or session to the desired color.
.PARAMETER Color
Specifies the color - "Black","Blue","Forest","Grey","Orange","Royal","Yellow","Purple","Black","Red","Green"
.PARAMETER Session
Specifies the session
.PARAMETER Vault
Specifies the vault/repository that contains the session
.PARAMETER DataSource
Specifies the Data Source that contains the vault/repo
.EXAMPLE
Set-RDMFolderColor -Color "Green" -Session "ID" -vault "VaultName" -DataSource "DataSourceName"
#>
[CmdletBinding()]
param (
[Parameter(Mandatory=$True)]
[ValidateSet("Black","Blue","Forest","Grey","Orange","Royal","Yellow","Purple","Black","Red","Green")]
[String]
$Color,
[Parameter(Mandatory=$True)]
[String]
$Session,
[Parameter()]
[String]
$Vault,
[Parameter()]
[String]
$DataSource
)
begin {
#refresh the connection to RDM to prevent errors
Update-RDMUI
}
process {
try {
#set the current data source, if needed
if ($DataSource -ne ""){
Set-RDMCurrentDataSource "$Datasource"
Update-RDMUI
}
#set the current repository/vault, if needed
if ($Vault -ne ""){
Set-RDMCurrentRepository -Repository $vault
Update-RDMUI
}
#retreive the session, using the ID
$RDMsession = Get-RDMSession | Where-Object {$_.id -eq $Session}
#set the color
$RDMSession.ImageName = "["+$Color+"]"
#save the session back in the Data Source
Set-RDMSession -Session $RDMsession
}
catch {
Write-Output $Error[0]
}
}
end {
#refresh the connection to RDM to prevent errors
Update-RDMUI
}
}
function Set-RDMImage {
<#
.SYNOPSIS
Set the image and color of the entry
.DESCRIPTION
This function sets a custom icon and color to an entry in RDM
.PARAMETER Image
Specifies the image of the folder
.PARAMETER Session
Specifies the session of the folder
.PARAMETER Vault
Specifies the vault/repository that contains the session
.PARAMETER DataSource
Specifies the Data Source that contains the session
.EXAMPLE
Set-RDMImage -image "FlagGreen" -Session $session -vault $vault -DataSource $datasource
#>
[CmdletBinding()]
param (
[Parameter(Mandatory=$True)]
[String]
$Image,
[Parameter(Mandatory=$True)]
[String]
$Session,
[Parameter()]
[String]
$Vault,
[Parameter()]
[String]
$DataSource
)
begin {
#refresh the connection to RDM to prevent errors
Update-RDMUI
}
process {
try {
#set the current data source, if needed
if ($DataSource -ne ""){
Set-RDMCurrentDataSource "$Datasource"
Update-RDMUI
}
#set the current repository/vault, if needed
if ($Vault -ne ""){
Set-RDMCurrentRepository -Repository $vault
Update-RDMUI
}
#retreive the session, using the ID
$RDMsession = Get-RDMSession | Where-Object {$_.id -eq $Session}
#set the image - Sample is required first
$RDMSession.ImageName = "Sample$Image"
#save the session back in the Data Source
Set-RDMSession -Session $RDMsession
}
catch {
Write-Output $Error[0]
}
}
end {
#refresh the connection to RDM to prevent errors
Update-RDMUI
}
}
Best regards,
Richard Boisvert
Very useful, exactly what I was looking for! Thank you very much.
Hi,
new error I would like help with, is not connected to changing properties, but general error when programmatically trying to create sessions, I don't get any visible error running the code:
$exist = New-RDMSession -Name "Usernames & Passwords" -Group $($selectedcusomer.Group) -Type Group Set-RDMSession -Session $exist $exist.ImageName = "SampleContactRoyal" Set-RDMSession -Session $exist Update-RDMUI
When I check result after New-RDMsession I get ID of the object to be created. Code executes, result not visible, now I found in logs on SQL server:SqlException - Violation of PRIMARY KEY constraint 'PK_Connections'. Cannot insert duplicate key in object 'dbo.Connections'. The duplicate key value is (4df99c3a-e6a7-4442-8437-da085f6f3775).The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Devolutions.Server.DatabaseManager.ExecuteNonQuery(String sql, DbTransaction dbTransaction, IEnumerable`1 parameters, CommandType commandType) at Devolutions.Server.ConnectionManager.c13e8fab77d26fbbcac1ef8fe8645d9f0(SessionContext c7f73d40d473700e7f67b5ed4acf6d298, ConnectionInfoEntity c6aea3d31dfb3fea36c5f53f7fe93584c, DbTransaction c5a0ca8eaa594113c2f0b3cfe13dedff9) at Devolutions.Server.ConnectionManager.c9ecc014229d994c135ae02cb42dfa547(SessionContext c7f73d40d473700e7f67b5ed4acf6d298, ConnectionInfoEntity c6aea3d31dfb3fea36c5f53f7fe93584c, UserEntity cf98b881282579a38f0d3820b4755fa4a, DbTransaction c5a0ca8eaa594113c2f0b3cfe13dedff9, Guid c361d32ed9dbabdaa7e15d7e959021cd8, Dictionary`2 cf3b2395eb94abbd7052922a66349b139, Boolean c4f0940f259977a34b0939d89d9dea981, Boolean c56af279219bde2919e276e18f96de802) at Devolutions.Server.ConnectionManager.cd64e9f81da1ef9e09c07e2586c4b5e43(SessionContext c7f73d40d473700e7f67b5ed4acf6d298, ConnectionInfoEntity[] c8b9368e8e9d0e1c8ae5f4495ba89d50b, UserEntity cf98b881282579a38f0d3820b4755fa4a, DbTransaction c5a0ca8eaa594113c2f0b3cfe13dedff9, Guid c361d32ed9dbabdaa7e15d7e959021cd8, Dictionary`2 cf3b2395eb94abbd7052922a66349b139, Boolean c4f0940f259977a34b0939d89d9dea981, Boolean cd99b71f8e8b8e520f02f1c3eb3d7e7b5) at Devolutions.Server.ConnectionManager.SaveConnection(SessionContext context, ConnectionInfoEntity connection, UserEntity user, Guid repositoryId, Dictionary`2 savedGroups, Boolean addLogs, Boolean giveNewRootAccess)
Any idea what I am doing wrong? I try to do Update-RDMUI after every change...
Best regards,
Rok
Hello RokB,
Sorry for the delayed answer. I just tested your snippet (modified a bit) and it works fine on my side
$exist = New-RDMSession -Name "Usernames & Passwords" -Group "Usernames & Passwords" -Type Group $exist.ImageName = "SampleContactRoyal" Set-RDMSession -Session $exist Update-RDMUI
Could you provide the value of $exist | fl *
Best regards,
Richard Boisvert
code with comments is attached. $collectionUsers you can create by importing: $collectionUsers = import-clixml -path "<path_to_xml>
Anyhow, I am stuck already before that, line 43-45, create a Group with name "Usernames & Passwords".
The code step by step:
PS C:\> Get-RDMCurrentVault
Description ID IsAllowedOffline Name
----------- -- ---------------- ----
Vault for Nuclear Tests 37a6520d-ef59-4769-bcce-6a484e0783c6 True TestingBulk
PS C:\> Get-RDMCurrentDataSource
ID : 41c1b68e-4208-4e52-9267-c42422b3e2a4
IsConnected : True
IsOffline : False
Name : TESTRDM-LKP-1
Type : RDMS
PS C:\> $Sessions = Get-RDMSession
PS C:\> $Sessions.Count
4
PS C:\> $selectedcusomer = $sessions | ? {(($_.ConnectionType -eq "Group") -or ($_.ConnectionType -eq "Folder")) -and (($_.Group.split("\")[2]) -eq $null) -and !(($_.Group.split("\")[1]) -eq $null)} | Out-GridView -OutputMode Single -Title "$((Get-RDMCurrentDataSource).Name) - $((Get-RDMCurrentRepository).Name) - Select a destiantion folder - customer that you will create credential entries for:"
PS C:\> $selectedcusomer
Name Group ID
---- ----- --
Customer1 Location1\Customer1 8c5acb76-2f30-4677-8ca3-c30139fee714
PS C:\> $customersessions= $Sessions | ? {$_.Group -like "$($selectedcusomer.Group)\*"}
PS C:\> $exist = $customersessions | ? {$_.Name -eq "Usernames & Passwords"}
PS C:\> $exist
PS C:\> $exist -eq $null
True
PS C:\> $exist = New-RDMSession -Name "Usernames & Passwords" -Group $($selectedcusomer.Group) -Type Group
PS C:\> $exist
Name Group ID
---- ----- --
Usernames & Passwords Location1\Customer1\Usernames & Passwords 12f1be0e-6be9-4e99-85ea-b2545507647d
PS C:\> $exist | fl *
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 : True
UsesPrinters : False
UsesSerialPorts : False
UsesSmartDevices : False
AllowClipboard : False
AllowPasswordVariable : False
AllowViewPasswordAction : False
AlternalteHostVPNBefore : False
AlternateHostAllowCustomHost : False
AutomaticallyClose : False
DomainHostOverride : False
Embedded32DebugMode : False
Encrypt : False
ExcludeFromNotifications : False
ExludeFromOpenedSession : False
GoOfflineOnConnect : False
IncludeInFavorite : False
OpenEmbedded : True
PromptCredentials : False
SharedTemplate : False
ShowFooterEmbedded : False
ShowInTrayIcon : True
Undocked : False
UseVPN : False
Image :
TemplateGroupData :
ApplicationIntegrationMode : Default
AuthentificationLevel : Default
ScreenColor : C32Bits
ScreenSize : Default
SoundHook : Default
WebBrowserApplication : Default
AlternateHostMode : Default
ColorMode : Custom
ConnectionStringMode : Default
ConnectionType : Group
CredentialInheritedMode : Default
DescriptionMode : Text
DisplayMonitor : Default
DisplayVirtualDesktop : Current
DomainOverrideType : Default
ForeColorStyle : Status
IntelligentCacheAction : AddUpdate
KeyboardHook : Default
PinEmbeddedMode : Default
PingConnectionMethod : Default
PingConnectionMode : Default
ReconnectMode : Default
ShowDocumentationTab : Inherited
TabGroupMode : Custom
TemplateSearchPathMode : None
UndockMaximized : Default
UserNameFormat : Default
Visibility : Default
AutomaticallyCloseInterval : 0
HostPort : 0
PingConnectionScanPort : 0
SortPriority : 0
SubMode : 0
WakeOnLANPort : 0
ID : 12f1be0e-6be9-4e99-85ea-b2545507647d
SecurityGroup : 00000000-0000-0000-0000-000000000000
AlternateShell :
CommandLine :
CommandLineWorkingDirectory :
RDPFileName :
ShellWorkingDirectory :
Url :
WebBrowserUrl :
AlternateHosts :
ClearTextPassword :
ClearTextPrivateKeyData :
Color :
ConfluenceDocumentationUrl :
ConnectionStringConnectionID :
ConnectionSubType :
CreatedBy :
CreationSource :
CredentialConnectionGroup :
CredentialConnectionID :
CredentialConnectionSavedPath :
CredentialDynamicDescription :
CredentialDynamicValue :
CredentialPrivateVaultSearchString :
CustomDnsServer :
CustomPort :
CustomStatus :
Data :
DataFileName :
Description :
DescriptionRtf :
DescriptionUrl :
DocumentLinkConnectionID :
ForeColor :
Group : Location1\Customer1\Usernames & Passwords
GroupCredentialPrompt :
GroupTab :
Host :
HostDomain :
HostFull :
HostNetworkInterfaceMac : en0
HostUserName :
HostWithPort :
ImageMD5 :
ImageName :
Name : Usernames & Passwords
PamCredentialID :
PamCredentialName :
PersonalConnectionID :
PrivateKeyConnectionID :
Stamp : 0e7c636c-a1b5-4492-97fb-356730c527d4
Status :
StatusLockedBy :
StatusMessage :
SwitchDataSourceID :
SwitchDataSourceName :
SwitchRepositoryFolder :
SwitchRepositoryID :
SwitchRepositoryName :
TabTitle :
TemplateName :
TemplateSearchPath :
TemplateSecurityGroup :
TemplateSourceID : aee5dc47-81fe-49df-a900-2ff9cca9fbe1
UpdatedBy :
WakeOnLANBroadcastIPAddress :
VNCOptions :
VNCUrl :
VPNDomain :
VPNName :
VPNSafePassword :
VPNUserName :
CreationDateTime :
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
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
HpRGS : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSHpRGSConnection
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
PCAnywhere : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSPCAnywhereConnection
PlayList : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSPlayListConnection
PowerShell : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSPowerShellConnection
ProxyServer : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSProxyServerConnection
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
RDP : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRDPConnection
Recording : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRecordingConnection
RemoteAssistance : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRemoteAssistanceConnection
RemoteCommand : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRemoteCommandConnection
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
ScreenConnect : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSScreenConnectConnection
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
VirtualPC : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSVirtualPCConnection
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
Wayk : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWaykConnection
WaykDen : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWaykDenConnection
Web : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWebConnection
WebDav : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWebDavConnection
WindowsAdminCenter : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWindowsAdminCenterConnection
WindowsVirtualPC : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWindowsVirtualPCConnection
XenServer : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSXenServerConnection
XWindow : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSXWindowConnection
PS C:\> $exist.ImageName = "SampleContactRoyal"
PS C:\> Set-RDMSession -Session $exist
PS C:\> Update-RDMUI
PS C:\> $customersessions= $Sessions | ? {$_.Group -like "$($selectedcusomer.Group)\*"}
PS C:\> $customersessions
PS C:\> $selectedcusomer.Group
Location1\Customer1It looks like successful, but without the result.
In event log I didn't get any error this time. In database I can see it:
In web I can see that I created it, anyhow it is not seen when browsing there:
Could be something to do with cache? It should sync when running Update-RDMUI?
Best regards,
Rok
TRN_Users_202010070307.xml
the_code.ps1.txt
I compared to existing one, looks like I am doing something wrong when defining ImageName:
Not just that what is bothering creation, tried to assign imageMD5:
PS C:\> $exist = New-RDMSession -Name "Usernames & Passwords" -Group $($selectedcusomer.Group) -Type Group
PS C:\> $exist.ImageName = "SampleContactRoyal"
PS C:\> $exist.ImageMD5 = "b82cd95a73a8315bdbcc2e05daa9c4a6"
PS C:\> Set-RDMSession -Session $exist
PS C:\> Update-RDMUI
PS C:\> $exist | fl *
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 : True
UsesPrinters : False
UsesSerialPorts : False
UsesSmartDevices : False
AllowClipboard : False
AllowPasswordVariable : False
AllowViewPasswordAction : False
AlternalteHostVPNBefore : False
AlternateHostAllowCustomHost : False
AutomaticallyClose : False
DomainHostOverride : False
Embedded32DebugMode : False
Encrypt : False
ExcludeFromNotifications : False
ExludeFromOpenedSession : False
GoOfflineOnConnect : False
IncludeInFavorite : False
OpenEmbedded : True
PromptCredentials : False
SharedTemplate : False
ShowFooterEmbedded : False
ShowInTrayIcon : True
Undocked : False
UseVPN : False
Image :
TemplateGroupData :
ApplicationIntegrationMode : Default
AuthentificationLevel : Default
ScreenColor : C32Bits
ScreenSize : Default
SoundHook : Default
WebBrowserApplication : Default
AlternateHostMode : Default
ColorMode : Custom
ConnectionStringMode : Default
ConnectionType : Group
CredentialInheritedMode : Default
DescriptionMode : Text
DisplayMonitor : Default
DisplayVirtualDesktop : Current
DomainOverrideType : Default
ForeColorStyle : Status
IntelligentCacheAction : AddUpdate
KeyboardHook : Default
PinEmbeddedMode : Default
PingConnectionMethod : Default
PingConnectionMode : Default
ReconnectMode : Default
ShowDocumentationTab : Inherited
TabGroupMode : Custom
TemplateSearchPathMode : None
UndockMaximized : Default
UserNameFormat : Default
Visibility : Default
AutomaticallyCloseInterval : 0
HostPort : 0
PingConnectionScanPort : 0
SortPriority : 0
SubMode : 0
WakeOnLANPort : 0
ID : f209b7fd-dd1e-49fb-9971-3266d86f2f6f
SecurityGroup : 00000000-0000-0000-0000-000000000000
AlternateShell :
CommandLine :
CommandLineWorkingDirectory :
RDPFileName :
ShellWorkingDirectory :
Url :
WebBrowserUrl :
AlternateHosts :
ClearTextPassword :
ClearTextPrivateKeyData :
Color :
ConfluenceDocumentationUrl :
ConnectionStringConnectionID :
ConnectionSubType :
CreatedBy : *************
CreationSource :
CredentialConnectionGroup :
CredentialConnectionID :
CredentialConnectionSavedPath :
CredentialDynamicDescription :
CredentialDynamicValue :
CredentialPrivateVaultSearchString :
CustomDnsServer :
CustomPort :
CustomStatus :
Data :
DataFileName :
Description :
DescriptionRtf :
DescriptionUrl :
DocumentLinkConnectionID :
ForeColor :
Group : Test1 (location)\Customer_Name_folder\Usernames & Passwords
GroupCredentialPrompt :
GroupTab :
Host :
HostDomain :
HostFull :
HostNetworkInterfaceMac : en0
HostUserName :
HostWithPort :
ImageMD5 : b82cd95a73a8315bdbcc2e05daa9c4a6
ImageName : SampleContactRoyal
Name : Usernames & Passwords
PamCredentialID :
PamCredentialName :
PersonalConnectionID :
PrivateKeyConnectionID :
Stamp : 72dcf393-aede-4526-b604-243a0040312a
Status :
StatusLockedBy :
StatusMessage :
SwitchDataSourceID :
SwitchDataSourceName :
SwitchRepositoryFolder :
SwitchRepositoryID :
SwitchRepositoryName :
TabTitle :
TemplateName :
TemplateSearchPath :
TemplateSecurityGroup :
TemplateSourceID : b3bf2d0a-f77b-456a-a51f-f4543eb5687b
UpdatedBy :
WakeOnLANBroadcastIPAddress :
VNCOptions :
VNCUrl :
VPNDomain :
VPNName :
VPNSafePassword :
VPNUserName :
CreationDateTime : 2020-10-07 16:43:44
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
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
HpRGS : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSHpRGSConnection
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
PCAnywhere : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSPCAnywhereConnection
PlayList : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSPlayListConnection
PowerShell : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSPowerShellConnection
ProxyServer : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSProxyServerConnection
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
RDP : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRDPConnection
Recording : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRecordingConnection
RemoteAssistance : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRemoteAssistanceConnection
RemoteCommand : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSRemoteCommandConnection
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
ScreenConnect : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSScreenConnectConnection
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
VirtualPC : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSVirtualPCConnection
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
Wayk : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWaykConnection
WaykDen : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWaykDenConnection
Web : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWebConnection
WebDav : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWebDavConnection
WindowsAdminCenter : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWindowsAdminCenterConnection
WindowsVirtualPC : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSWindowsVirtualPCConnection
XenServer : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSXenServerConnection
XWindow : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSXWindowConnection
SQL:
GUI:
This is not going in right direction, I have already created a few of them with the same path, same name (probably I should test in a "new folder"):
Hello RokB,
Setting the imageMD5 is not required, once the session is saved, it should auto-populate that field. As a test, could you try to create the folder by hardcoding (or without) the -group parameter and see if it works?
To validate, what version of DPS are you using? A refresh may be required in RDM to see the entry after the the Update-RDMUI.
Best regards,
Richard Boisvert
Hi,
DPS version: 2020.2.10, Office365Auth, RDM 2020.2.19
Cleaned up all session (connections) I created in SQL Connections and ConnectionsHistory tables. I can see that no error is created since it is successful (even the icon is applied). But it appears in the GUI (RDM or web) only if I restart IIS (the connections I created earlier didn't appear at all even after several days, so I guess it is not only "cache" thing). I tried using CTRL+F5 after every change, sometimes even delete cache from RDM's datasource GUI interface/logoff/Refresh. Any other way to forcefully re-read info from database?
I can probably even reproduce the "error" every time, I will do some investigation. Problem is that I cannot change created session before IIS restart (trouble some if I need to add sessions in a folder)...
Do I get process of creation of sessions (my case credential entry) right in steps:
But I guess problem commes from other source than PS, since even if I do that in GUI, no values are visible before IIS restart... Could be authentication? I will try on another instance where I have win auth...
Hello RokB,
For the steps, you can set the properties in $variable before you do the Set-RDMSession, it will save one command from your script.
As for the IIS issue, it seems to be a problem with your DPS, so it would be unrelated to PowerShell. If you have a test environment, you can test it there. The entries are in the SQL Server, so the issue should not be on that side, but it may be a problem with the decrypting performed by DPS. If this is the case, I would recommend sending us a log from your DPS to ticket@devolutions.net and we will create a ticket and have a look with you.
On the DPS website, turn on Log debug information under Administration - Password Server Settings - Logging, run the PS script and try to refresh RDM, with the IIS reset if necessary. You can then send us the Data Sources Logs under the Reports tab on the website. You should then turn off the debug mode.
Best regards,
Richard Boisvert