Showing Username and Passwort from Objects where Imported with Powershell

Showing Username and Passwort from Objects where Imported with Powershell

avatar

Hello Devolutions Forum,

I import several Sessions and Folders with Powershell. On the Folder I set the Username, Domain and password. Under the folder I save the session an set the Credntials to inherit.
The Session works without Problems.
When I open the folder Object to show the Username it is empty. When I copy the Object I can See the username entry in xml.
The gui don´t showing the username.
Why?

Im Import the username, password and domain with Set-RDMSessionUsername, Set-RDMSessionDomain and Set-RDMSessionPassword

Greetings Sebastian

All Comments (9)

avatar

Hello,

That is really a strange behaviour. I just tried to replicate it without success. I have few questions to ask to verify if I can reproduce it.

What RDM version are you using?

What RDM PowerShell module version are you using? You can get the information using the Get-RDMInstance cmdlet.

Have you saved the information on the folder using the Set-RDMSession?

What folder type are you using?

Best regards,

Érica Poirier

avatar

Hello Erica,

as I wrote I use : "Im Import the username, password and domain with Set-RDMSessionUsername, Set-RDMSessionDomain and Set-RDMSessionPassword".

Is the right way always to use Set-RDMSession?

RDM Version is: 2022.3.27.0 64bit
Powershell Modul version is: 2022.2.0.0

Greetings Sebastian

avatar

Hello,

Thank you for your feedback.

Once you have updated the properties with Set-RDMSessionUsername, Set-RDMSessionDomain and Set-RDMSessionPassword, to save these in the entry, we need to run the Set-RDMSession cmdlet.

As you are using RDM 2022.3, you must use the same RDM PowerShell module version. Please update it with Update-Module -Name RemoteDesktopManager and make sure you are using the same major module version 2022.3.

Let me know if that helps.

Best regards,

Érica Poirier

avatar

Hello Erica,

i don't understand how to use Set-RDMSessionUsername, Set-RDMSessionDomain and Set-RDMSessionPassword with Set-RDMSession cmdlet.

In my opinion when I do this,

if ($helpsplit[$i-1] -like "*bla*" -or $helpsplit[$i-1] -like "*blub*") {
        Set-RDMSessionUsername -ID $session.ID -Username $csvEntry.User
        Set-RDMSessionDomain -ID $session.ID -Domain $csvEntry.Domain
        $securestring = ConvertTo-securestring $csvEntry.Password -asplaintext -force
        Set-RDMSessionPassword -ID $session.ID -Password $securestring
    }
I don't have to use Set-RDMSession. It writes directly to the session. When I want to change session name or ip adress i have to use Set-RDMSession. Or did I get this wrong?

I updated to Powershell Module 2022.3 now i can see Username, Domain an Password. Thank you!

Greetings
Sebastian

avatar

Hello Sebastian,

Glad updating the RDM module helped.

When you want to save multiple changes, you should use the following, since it will only write once in the data source, instead of three times.

$session.username = $csvEntry.User
$session.domain= $csvEntry.Domain
$session.username = (ConvertTo-securestring $csvEntry.Password -asplaintext -force)
Set-RDMSession $session


Best regards,

Richard Boisvert

avatar

Hello Richard,

okay I will try.

Thank You.

Greetings
Sebastian

avatar

Hello Richard,

there are no Properties like "username" or "password" in $session. Example ILO Session.

DocumentData                        :
HostResolved                        : 10.60.xxx.x
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
Encrypt                             : False
ExcludeFromNotifications            : False
ExludeFromOpenedSession             : False
GoOfflineOnConnect                  : False
IncludeInFavorite                   : False
OpenEmbedded                        : True
PromptCredentials                   : False
SharedTemplate                      : False
ShowInTrayIcon                      : True
Undocked                            : False
UseVPN                              : False

Image                               :
TemplateGroupData                   :
DocumentationExternalType           : Default
DocumentationType                   : Markdown
ShowDocumentationTab                : Inherited
ApplicationIntegrationMode          : Default
AuthentificationLevel               : Default
ScreenColor                         : C32Bits
ScreenSize                          : Default
SoundHook                           : Default
WebBrowserApplication               : Default
AlternateHostMode                   : Default
ColorMode                           : Custom
ConnectionStringMode                : Default
ConnectionType                      : Ilo
CredentialInheritedMode             : Default
DescriptionMode                     : Text
DisplayMonitor                      : Default
DisplayVirtualDesktop               : Current
DomainOverrideType                  : Default
ForeColorStyle                      : Status
HostSourceMode                      : SessionSpecific
IntelligentCacheAction              : AddUpdate
KeyboardHook                        : Default
PinEmbeddedMode                     : Default
PingConnectionMethod                : Default
PingConnectionMode                  : Default
ReconnectMode                       : Default
RiskyEvents                         : Default
TabGroupMode                        : Custom
TemplateSearchPathMode              : None
UndockMaximized                     : Default
UserNameFormat                      : Default
Visibility                          : Default
AutomaticallyCloseInterval          : 0
HostPort                            : 0
PingConnectionScanPort              : 0
SortPriority                        : 0
SubMode                             : 0
WakeOnLANPort                       : 0
ID                                  : 5f337ffa-xxxx-xxxx-926e-d741ef9c0b80
SecurityGroup                       : 00000000-0000-0000-0000-000000000000
UserVaultMigrationID                : 00000000-0000-0000-0000-000000000000
ConfluenceDocumentationUrl          :
DocumentationTitle                  :
AlternateShell                      :
CommandLine                         :
CommandLineWorkingDirectory         :
RDPFileName                         :
ShellWorkingDirectory               :
Url                                 :
WebBrowserUrl                       :
AlternateHosts                      :
ClearTextPassword                   :
ClearTextPrivateKeyData             :
Color                               :
ConnectionStringConnectionID        : 
ConnectionSubType                   :
CreatedBy                           : y73xx
CreationSource                      :
CredentialConnectionGroup           :
CredentialConnectionID              :
CredentialConnectionSavedPath       :
CredentialDynamicDescription        :
CredentialDynamicValue              :
CredentialPrivateVaultSearchString  :
CustomDnsServer                     :
CustomImageID                       :
CustomPort                          :
CustomStatus                        :
Data                                :
DataFileName                        :
Description                         :
DescriptionRtf                      :
DescriptionUrl                      :
DocumentLinkConnectionID            :
ForeColor                           :
Group                               : Schulen\xxx\Gesamtschule\xxxxxx
GroupCredentialPrompt               :
GroupMain                           : Schulen\xxx\Gesamtschule\xxxxxx
GroupTab                            :
Host                                : 10.60.xxx.x
HostConnectionID                    :
HostConnectionSavedPath             :
HostDomain                          :
HostFull                            : 10.60.xxx.x
HostNetworkInterfaceMac             : en0
HostUserName                        :
HostWithPort                        : 10.60.xxx.x
ImageMD5                            :
ImageName                           :
Name                                : [10.60.xxx.x] iLO
PamCredentialID                     :
PamCredentialName                   : 
ParentID                            :
PersonalConnectionID                :
PrivateKeyConnectionID              :
PrivateKeySearchString              :
RepositoryID                        : 00000000-0000-0000-0000-000000000000
Status                              :
StatusLockedBy                      :
StatusMessage                       :
SwitchDataSourceID                  :
SwitchDataSourceName                :
SwitchRepositoryFolder              :
SwitchRepositoryID                  :
SwitchRepositoryName                :
TabTitle                            :
TemplateName                        :
TemplateSearchPath                  :
TemplateSecurityGroup               :
TemplateSourceID                    : eb407be9-xxxx-xxxx-8883-6c1d4da17294
UpdatedBy                           : y73xx
WakeOnLANBroadcastIPAddress         :
VNCOptions                          :
VNCUrl                              :
VPNDomain                           :
VPNName                             :
VPNSafePassword                     :
VPNUserName                         :
CreationDateTime                    : 13.01.2023 13:23:16
UpdateDateTime                      : 13.01.2023 13:25:45
ActiveDirectoryConsole              : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSActiveDirectoryConsoleConnection
AddOn                               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSAddOnConnection
Agent                               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSAgentConnection
AppleRemoteManagement               : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSAppleRemoteManagementConnection
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
CustomImage                         : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSCustomImageConnection
CyberArkDashboard                   : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSCyberArkDashboardConnection
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
DvlsPamDashboard                    : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSDVLSPamDashboardConnection
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
PAM                                 : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSPamConnection
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
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
SMB                                 : RemoteDesktopManager.PowerShellModule.PSOutputObject.PSSMBConnection
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

So I get this error when i try to set Username

Die Eigenschaft "username" wurde für dieses Objekt nicht gefunden. Vergewissern Sie sich, dass die Eigenschaft vorhanden ist und festgelegt werden kann.
In U:\y7328\Projekt_RDM\RDM-Manager\current\RDM-Import.ps1:175 Zeichen:9
+ $session.username = $csvEntry.User
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException

So I use Set-RDMSessionUsername to get it work.

Greetings

Sebastian

avatar

Hello Sebastian,

You are correct, depending on the type of session, such as the one above, it can use HostUserName instead. You can use Set-RDMSessionUsername instead, just to be safe.

Best regards,

Richard Boisvert

avatar

Hello Richard,

okay. Thank you!

Greetings
Sebastian