Proper working with attachment using Powershell (Add-RDMEntryAttachment x Add-RDMSessionAttachment)
Hello Patrick,
thank you for your reply.
I actually did not test your code—I assume it will work—but unfortunately it is not usable for my use case.
In my opinion, it is only a kind of workaround for a poorly designed procedure Add-RDMEntryAttachment with the -PassThru argument, which returns not only the newly added attachment but all attachments with the same filename.
I found my own workaround by including a timestamp in the filename, which makes each filename unique. This way, Add-RDMEntryAttachment -PassThru returns a reference to only one attachment—the most recently added one. In my situation, this approach is more reliable.
Best regards,
Ivo
Proper working with attachment using Powershell (Add-RDMEntryAttachment x Add-RDMSessionAttachment)
Greetings everyone,
I would like to ask for clarification on the proper use of Add-RDMEntryAttachment and Add-RDMSessionAttachment for adding session/entry attachments.
I have been using Add-RDMSessionAttachment for years. It was not ideal, but it worked.
It seems that some changes were made to Add-RDMSessionAttachment, and it no longer accepts the -Title and -Description parameters.
I tried using Add-RDMEntryAttachment — it does add an attachment, yes, but that’s all. There is no result, sometimes it freezes, and there is no reference returned to the added attachment.
Even the example in the documentation for Add-RDMEntryAttachment does not make sense to me. When using the -PassThru parameter, it returns references to all attachments, so it updates the title and description on multiple items, not only on the most recently added one:
$entry = Get-RDMEntry -Name EntryA
$attachment = Add-RDMEntryAttachment -InputObject $entry -Filename 'filename.txt' -PassThru
Set-RDMEntryAttachment -InputObject $attachment -Title 'Filename' -Description 'This is an important file'I would simply like to add an attachment with a Title and Description to an RDM session using PowerShell.
Many thanks to anyone who can clarify this.
Best regards,
Ivo Pastyrik
Attachments in offline mode
Hello,
I will really appreciate offline attachment in some feature release of RDM.
I'm sure that I'm not alone who is missing this feature.
Thank you.
Ivo
Attachments in offline mode
Greetings to all.
As we are using attachments for storing some information to session and we are working mostly in offline mode.
It would be we useful to have also attachments accessible in offline mode.
Is it possible to include offline attachments this in some feature release of RDM ?
Many thanks.
Regards,
Ivo
RDM datasource handling - same data source in GUI and PS module, datasource reference from GUI to PS
Hello,
Yes, I'm connected as admin.
Both option Run as administrator and Run as different user are not selected.
Regards,
Ivo
RDM datasource handling - same data source in GUI and PS module, datasource reference from GUI to PS
Hello,
It is 2022.1.27.0 64bit Enterprise.
There are two datastores configured in GUI, but I can see only one datastore in PS.
C:\Users\admin> Get-RDMDataSource
ID : 4c97d0d1-06d1-4e25-8384-57c11142f6c0
IsConnected : True
IsOffline : False
Name : Local Data Source
Type : SQLiteC:\Users\admin> Get-RDMInstance
ApplicationVersion OptionFilename
------------------ --------------
2022.1.3.3 C:\Users\admin\AppData\Local\Devolutions\RemoteDesktopManager\RemoteDesktopManager.cfgThank you.
Best regards,
Ivo
RDM datasource handling - same data source in GUI and PS module, datasource reference from GUI to PS
Hello RDM professionals,
I would like to ask you for help with data source handling in RDM powershell module.
I have PowerShell (Macros/Sripts/Tools) script in RDM for storing configuration of different devices to RDM.
I’m calling this script via right click on session and selecting this script from Macros/Scripts/Tools menu.
Script is called with $SESSION_ID$ as argument, so it can find the RDM session, read username and password a then store configuration as attachment back to this session.
The problem is, that PS module does not share datasource information with RDM GUI (as it was before) – so PS module can not find the RDM session, because RDM datasource does not exist in PS or PS is looking for session in another datasource.
The main questions are:
1. How I can make sure that I have same definition of datasources in RDM’s GUI and RDM’s PS module (both on the same PC of course) ?
2. How I can pass datasource’s ID together with session’s ID from RDM’s GUI to RDM’s PS module, so script can use same datasource as GUI ?
Thank you in advance.
Best regards,
Ivo
Find RDM session by ID including Sub Connection
Hi Jonathan,
thank you for quick answer.
I know about $rdmSession.SubConnections.
Of course I can handle it by some PS code, but using something like
$rdmSession = Get-RDMSession -ID '12132154-4654645-45545' -IncludeSubConnection
$rdmAllSessions = Get-RDMSession -IncludeSubConnectionwould be more elegant...
Thank you.
Best regards,
Ivo
Find RDM session by ID including Sub Connection
Hello,
I need to find RDM session by ID - no matter if it is Connection or SubConnection.
I'm using code like this:
$rdmSession = Get-RDMSession | Where-Object { $_.ID -eq $RDMGuid }But, this does not include SubConnection.
Is there any way how to get all Sessions(Connections) including SubSession(SubConnections) ?
Is there any way how to read only one session with concrete ID and not all session and then filter out it using | ?
Thank you for any idea.
Ivo
get-RDMSessionUserName and get-RDMSessionPassword are not returning values
Hello,
yes it is, please see code below.
PS C:\Users\Admin> Get-RDMInstance
ApplicationVersion OptionFilename
------------------ --------------
2021.2.0.31 C:\Users\Admin\AppData\Local\Devolutions\RemoteDesktopManager\RemoteDesktopManager.cfg
PS C:\Users\Admin> $rdmSession= get-RDMSession | Where-Object { $_.ID -eq "xxxxxx10-cxxx-4xxx-a4xxx-0xxxxxxxxxxx3"}
PS C:\Users\Admin> $rdmSessionUser= Get-RDMSessionUserName -Session $rdmSession
PS C:\Users\Admin> $rdmSessionPassword= Get-RDMSessionPassword -Session $rdmSession -AsPlainText
PS C:\Users\Admin> $rdmSession.Name
[XX] Jxxxxxxx1 - LAN - Mikrotik RB3011
PS C:\Users\Admin> $rdmSessionUser
PS C:\Users\Admin> $rdmSessionPassword
PS C:\Users\Admin>
Thank you.
Ivo.
get-RDMSessionUserName and get-RDMSessionPassword are not returning values
Hello,
I'm using MS SQL server and it is main vault.
Thank you.
Ivo
get-RDMSessionUserName and get-RDMSessionPassword are not returning values
Hello,
with 2021.2.0.31 it is working with PS5, but in PS7.2 I'm not able to get username nor password.
Thank you.
Regards,
Ivo
get-RDMSessionUserName and get-RDMSessionPassword are not returning values
Hello Richard,
any news on this ?
Thank you.
Regards,
Ivo
get-RDMSessionUserName and get-RDMSessionPassword are not returning values
Hello Richard,
I sent you exported RDM Session via Direct Message.
Thank you.
Ivo
get-RDMSessionUserName and get-RDMSessionPassword are not returning values
Hello Richard,
yes, $rdmSession is populated.
Actually none of get-RSMSessionUsername or get-RDMSessionPassword are returning any value.
Any idea ?
PS C:\Users\Admin> $rdmSession | fl Name,ConnectionType,CredentialConnectionID
Name : AA57 - LAN - Mikrotik RB3011
ConnectionType : AddOn
CredentialConnectionID : 19xxxxx5-f768-4408-9a2f-17xxxxxxxx0
PS C:\Users\Admin> Get-RDMSessionUserName -Session $rdmSession
PS C:\Users\Admin> Get-RDMSessionPassword -Session $rdmSession -AsPlainText
PS C:\Users\Admin>Thank you,
Best regards,
Ivo
get-RDMSessionUserName and get-RDMSessionPassword are not returning values
Hello,
I would like to ask you for help with get-RDMSessionUserName and get-RDMSessionPassword.
I have simple script, that is getting username and password from RDM session for connection to device via SSH.
It was working perfectly in legacy powershell module.
But now with new PS module from GitHub (2021.2.0.27) Get-RDMSessionUserName and Get-RDMSessionPassword
are NOT returning any values.
$rdmSession= get-RDMSession | Where-Object { $_.ID -eq $rdmSessionGuid }
$rdmSessionUser= Get-RDMSessionUserName -Session $rdmSession
$rdmSessionPassword= Get-RDMSessionPassword -Session $rdmSession
Thank you for any help.
Best regards,
Ivo
Save Document ConnectionType to file example
Hello,
yes, it works (with two little tweaking)
$path="C:\temp"
$session = Get-RDMSession -IncludeDocumentsStoredInDatabase
$fileName = $session.Document.Filename
$destination = Join-Path $path "\$fileName"
$fileInBytes = $session.DocumentData
[io.file]::WriteAllBytes($destination, $fileInBytes)Many thanks.
Best regards,
Ivo
Save Document ConnectionType to file example
Hello,
is there any example how to save document to disk from connection which has ConnectionType=Document ?
I tried something, but it is not working at all.
I will appreciate any help.
Thank you.
Ivo
Add PortKnock function to other network tool in Macros/Scripts/Tools
Hello,
PortKnock
is great feature that was integrated to RDM and works before opening seesion.
But it would be
great to add ProtKnock function to other network tools beside Ping, Port scan –
so I can call PortKnock function only on existing session without actually opening
it.

Thank you.
Port knock not only for SSH session
Hello,
thank you for quick response and adding this feature.
Best regards,
Ivo Pastyrik
Running script/tools on folder withou asking for individual sessions
Hello,
I have few scripts for RDM, that are working with RDM
Folders.
Script process all sessions (of some type) in RDM folder and
performs some action for example check vulnerability or backup config.
When I run this script via right click and
Macros/Scripts/Tools menu, then dialog for selecting session is displayed.
I need option to select what happen when I run Script on
folder – I need only pass ID of folder and run the script (script will take
care about all sub-session)
I discussed it before under DEVO-24334
Many thanks.
Best regards,
Ivo Pastyrik
Port knock not only for SSH session
Hello,
Port knock in RDM is great feature, but why it is available only
for SSH sessions ?
We are utilizing pork knock also for other types of
sessions, mainly for winbox.
Is it possible to add port knock feature also to other types of sessions ?
Thank you in advance.
Best regards,
Ivo Pastyrik
Add-RDMSessionAttachment check result - Success or Failure
Hello,
is there any way how to check result of Add-RDMSessionAttachment command ?
I need to know if adding of attachment was successful or not.
Thank you in advance.
Best regards,
Ivo
How to check is DataSource isonlie or offline
Hello,
thank you for reply.
We are using MS SQL as data source.
I want to stop processing of script at beginning when data source is offline, because I'm adding attachment to session at the end of script.
So it is not necessary to process whole script when attachment will not be added at the end while data source is offline.
Best regards,
Ivo Pastyrik
How to check is DataSource isonlie or offline
Hello.
is it possible to check if current DataSource is online or offline from powershell ?
Many thanks.
Regards,
Ivo Pastyrik