Users

All Posts (22)

avatar

(user deleted)

Disabled

NotImplementedException when running RDM Powershell's Get-RDMSession command

avatar
avatar
avatar
avatar

Fixed it! Thanks a ton!

Get-RDMSession: Connection not found in 2021.2.0.30

avatar
avatar
avatar

Thanks! It does not prompt - I did report the no prompt here in a similar issue: https://forum.devolutions.net/topics/36276/notimplementedexception-when-running-rdm-powershells-getrdmsession-com#155564

Get-RDMSession: Connection not found in 2021.2.0.30

avatar
avatar
avatar

Yes, TOTP

Get-RDMSession: Connection not found in 2021.2.0.30

avatar
avatar
avatar

SQL Server Database - AD integration for login. We also have 2 Factor enabled on the datasource.

Get-RDMSession: Connection not found in 2021.2.0.30

avatar
avatar
avatar

Get-RDMCurrentDataSource returns my datasource - though it show IsConnected as false.

It shows as this for both .30 and .22. One of them works, the other doesn't, and this is occurring for multiple team members.

Get-RDMSession: Connection not found in 2021.2.0.30

avatar
avatar
avatar

Hello, within RDM I have a script that makes the following call

$RDMServers = Get-RDMSession |

where {$_.ConnectionType -eq "RDPConfigured"}

In v2021.2.0.22 of the RDM Powershell module, this works fine. After installing the latest package, a simple Get-RDMSession fails with the error

Get-RDMSession : Connection not found.

At line:1 char:1

+ Get-RDMSession

+ ~~~~~~~~~~~~~~

+ CategoryInfo : InvalidOperation: (:) [Get-RDMSession], Exception

+ FullyQualifiedErrorId : 0,RemoteDesktopManager.PowerShellModule.GetRDMSessionComman

Is this a known issue or something that needs to be changed in my scripts with newer versions?

NotImplementedException when running RDM Powershell's Get-RDMSession command

avatar
avatar
avatar
avatar

Hello,

My apologies, I should have asked for your data source and not presumed it was Devolutions Server.

I quickly spoke with the engineering team and they will verify if it is possible to prompt for the 2FA in the command line.

Best regards,

No worries! For what its worth, and I should have stated this originally, the script still runs; its just a Get-RDMSession with a where clause in it that outputs to a CSV. It just is now generating this error.

NotImplementedException when running RDM Powershell's Get-RDMSession command

avatar
avatar
avatar
avatar

Hello,

For using the new RDM PowerShell module (or https://github.com/Devolutions/devolutions-server) with a Devolutions Server data source, you should instead use an application key: https://helpserver.devolutions.net/webinterface_applications.html

Best regards,

We aren't using Devolutions Server - only RDM. Is there a different process for RDM?

NotImplementedException when running RDM Powershell's Get-RDMSession command

avatar
avatar
avatar
avatar

Hello, we recently updated our Enterprise RDM instance to the latest version and when using RemoteDesktopManager Powershell v2021.2.0.22 to run Get-RDMSession, we get the following:

NotImplementedException - The method or operation is not implemented.                                                                                                                                                                                                                                                                                                                                                                                                  at RemoteDesktopManager.UIService.set_MessageShown(Boolean value)                                                                                                                                                                 at Devolutions.RemoteDesktopManager.Business.GoogleAuthenticatorTwoFactorDescriptor.Validate(String token, String accountName)
   at Devolutions.RemoteDesktopManager.Business.DataSources.BaseConnectionDataSource.UnlockTwoFactor(Boolean ignoreTwoFactorChecked)
   at Devolutions.RemoteDesktopManager.Managers.LockManager.EnsureDataSourceUnlockedTwoFactor(BaseConnectionDataSource dataSource)
   at Devolutions.RemoteDesktopManager.Managers.ConnectionManager.LoadConnectionsFromDataSource(ConnectionEngine engine, Boolean hasChanged)
   at Devolutions.RemoteDesktopManager.Managers.ConnectionManager.LoadConnections(BaseConnectionDataSource dataSource)

We have 2Factor enabled against the datasource - previously we were prompted with a 2Factor prompt, but now it seems to be having an issue with it.

Getting prompted for MFA when executing a script

avatar
avatar
avatar
avatar

Thank you Oxy,

I will submit a ticket to the engineering team to take a look at this :).

Great, thanks so much!

Getting prompted for MFA when executing a script

avatar
avatar
avatar
avatar

Hello Alexandre,

Yes, when launching just the RDM Powershell prompt, I get the MFA prompt.

Thanks!

Getting prompted for MFA when executing a script

avatar
avatar
avatar
avatar

Hello, not sure if this is best for this forum or the Macro/Script one.

I recently set up MFA on my RDM instance (checking off Force 2 Factor at the data source in System Settings>Security). Everything has been working great, however I'm encountering an odd issues. I have a few scripts saved in RDM that use the RDM Powershell, and are executed straight from RDM, an example is below. They are Local Powershell sessions, set to use an embedded script.

When running one of the scripts, after signing into RDM with MFA, users are prompted to enter another MFA code. If I just cancel out of the MFA prompt, the script still executes without issue. Similarly, if I import the RDM Module into a standard PS window with RDM completely closed, the script executes without the need for MFA.

Is there a way to make the script from RDM not prompt for MFA when executing? Or do I need to use different logic in any way? It seems like an unintended side-effect, as I'm able to execute it outside of RDM without issue. I've tried changing the credentials to use 'My Personal Credentials', changing the runAs to run as current session, and testing to see if RunAs Admin worked at all.

Thanks for taking the time to check this out!

Update properties on Sub-Connections

avatar
avatar
avatar

Figured this one out.

I ended up using Advance Search to select all my PSRemote options, then Batch Edited them all with a Powershell script:

$connection.Host = '$PARENT_INFORMATION_MACHINE_NAME$.$PARENT_MACHINE_DOMAIN$'

$RDM.Save();

Thanks!

Update properties on Sub-Connections

avatar
avatar
avatar

Hi Min,

Sorry for the late response. Your script doesn't seem to update the results. The following vars both pull back results as expected

$parent = Get-RDMSession | where ConnectionType -eq "RDPConfigured"
$child =  $parent.SubConnections | where {$_.ConnectionType -eq "PowerShellRemoteConsole"}

The foreach statement doesn't seem to be updating the Host (or anything as far as I can tell). I wonder if the PSRemote Host line is set as a different name than the RDP Host?

Update properties on Sub-Connections

avatar
avatar
avatar

Hello,

I have a bunch of RDPConfigured entries with PowerShellRemoteConsole sub-connections. I recently update all the RDPConfigured entires to use $INFORMATION_MACHINE_NAME$.$MACHINE_DOMAIN$ as the Host as we have multiple domains where its easier to pull in host/domain from information than manually updating each host using the following script:

$sessions = Get-RDMSession | 

where {$_.ConnectionType -eq "RDPConfigured"}

foreach ($session in $sessions) {

    $session.Host = 'INFORMATION_MACHINE_NAME$.$MACHINE_DOMAIN$'

    Write-Host "Name: $($session.Name) - Host: $($session.Host)"

    Set-RDMSession $session

}

Write-Host 'Done!'

Update-RDMUI

I'd like to do something similar with all my sub-connections to these entries, updating the host on those to be $PARENT_INFORMATION_MACHINE_NAME$.$PARENT_MACHINE_DOMAIN$. Is there a way to easily call to those sub-connections? I tried using PowerShellRemoteConsole in my where statement, however that doesn't seem to allow child items to be changed.

Thanks in advance!

Adding PSRemote subconnections for all RDPConfigured connections via Powershell

avatar
avatar
avatar
avatar

Thanks Min! That's pretty much what I was able to come up with after going off what Alexandre provided. This works for the most part, however it seems to be inserting two records. One sub-connection as expected, but also its own parent record:

Any thoughts?

EDIT: I ended up going with this solution and just deleting the extra Parent sessions it created. Was an easy enough job.

My real question now, is is possible to select all of these entries and enable 'Run As Admin'?

I know with an RDP session, you check off boxes like 'Is Virtual Machine by calling something like the following, but haven't found if there's a similar call for Run As Admin with PowershellRemoteConsole

$ServerEntry = New-RDMSession -Name $DeviceName -Host $DeviceName -Type "$Type"

$ServerEntry.MetaInformation.IsVirtualMachine = "True"

Set-RDMSession $ServerEntry 

Update-RDMUI

}

Adding PSRemote subconnections for all RDPConfigured connections via Powershell

avatar
avatar
avatar
avatar

Hello,

Would anyone happen to know of a way to script out adding PSRemote subconnections to all current RDPConfigured connections I have set up in RDM? I recently imported our whole server list from our old sharepoint site, and would love to be able to mass add subconnections to each of them via a script. A bonus if I can add them all with the 'Run As Admin' box checked off as well.

This is one I set up manually, just using the $PARENT_NAME$ variable.

Thanks in advance for any help!

Importing MetaInfomation from CSV file

avatar
avatar
avatar

When importing, is there a way to set the credential type? Specifically if I want each entry created to, by default, use 'My personal credentials'

Thanks,

Importing MetaInfomation from CSV file

avatar
avatar
avatar

Thanks Alexandre!

This is great information and cleans up my script quite a bit. Much appreciated!

Importing MetaInfomation from CSV file

avatar
avatar
avatar

Hello,

I took a look at the pinned Mass Import from CSV file thread and am running into an issue importing MetaInformation into the RDMSession that my script is importing. I have the following script, mostly copied from the pinned thread, though modified to use updated cmdlets. In testing, the script will add the two servers I have in the CSV file, however when looking in the properties panel, none of the metadata is being populated. I've tested to make sure the script is properly getting the information and looping through it. I do see in the Powershell window WARNING: Connection not found. So I'm wondering if its not properly finding the GUID of the $ServerEntry variable. Using RDM 2020.1 currently. Any thoughts?

Edit: I notice that if I try to access the RDP session in RDM with my imported servers, they won't work unless I open Properties>General, and populate the host by clicking into the Hosts field where it autopopulates. Could this play into the issue?

Edit 2: Added a -Host to the $ServerEntry variable definition to get around the Host field missing. Seems that is not the cause of the metadata issue.

$lineno = 0

Get-Content "C:\temp\RDMImportTest.csv" | ForEach-Object {

$lineno = $lineno + 1

$fields = $_.split(",")  
$DeviceName = $fields[0] -replace "^""", "" -replace """$", ""   
$Status = $fields[1] -replace "^""", "" -replace """$", ""
$Title = $fields[2] -replace "^""", "" -replace """$", ""
$Audience = $fields[3] -replace "^""", "" -replace """$", ""
$Subnet = $fields[4] -replace "^""", "" -replace """$", ""
$IP = $fields[5] -replace "^""", "" -replace """$", ""
$Description = $fields[6] -replace "^""", "" -replace """$", ""
$VMHost = $fields[7] -replace "^""", "" -replace """$", ""
$POC = $fields[8] -replace "^""", "" -replace """$", ""
$Priority = $fields[9] -replace "^""", "" -replace """$", ""
$Category = $fields[10] -replace "^""", "" -replace """$", ""
$Domain = $fields[11] -replace "^""", "" -replace """$", ""
$WindowsMachine = $fields[12] -replace "^""", "" -replace """$", ""
$OS = $fields[13] -replace "^""", "" -replace """$", ""
$BackupType = $fields[14] -replace "^""", "" -replace """$", ""
$Location = $fields[15] -replace "^""", "" -replace """$", ""

echo "Inserting RDM Entries from input line $lineno : $DeviceName"

$ServerEntry = New-RDMSession -Name $DeviceName -Type "RDPConfigured"
Set-RDMSession $ServerEntry 
Set-RDMSessionProperty $ServerEntry.ID -Path MetaInformation -Property Host -Value "$DeviceName" 
Set-RDMSessionProperty $ServerEntry.ID -Path MetaInformation -Property Version -Value "$Status" 
Set-RDMSessionProperty $ServerEntry.ID -Path MetaInformation -Property AssetTag -Value "$Title" 
Set-RDMSessionProperty $ServerEntry.ID -Path MetaInformation -Property CustomField1Value -Value "$Audience" 
Set-RDMSessionProperty $ServerEntry.ID -Path MetaInformation -Property Description -Value "$Description" 
Set-RDMSessionProperty $ServerEntry.ID -Path MetaInformation -Property Rack -Value "$VMHost" 
Set-RDMSessionProperty $ServerEntry.ID -Path MetaInformation -Property FirstName -Value "$POC" 
Set-RDMSessionProperty $ServerEntry.ID -Path MetaInformation -Property CustomField3Value -Value "$Priority" 
Set-RDMSessionProperty $ServerEntry.ID -Path MetaInformation -Property CustomField2Value -Value "$Category" 
Set-RDMSessionProperty $ServerEntry.ID -Path MetaInformation -Property Domain -Value "$Domain" 
Set-RDMSessionProperty $ServerEntry.ID -Path MetaInformation -Property CustomField4Value -Value "$BackupType" 
Set-RDMSessionProperty $ServerEntry.ID -Path MetaInformation -Property Rack -Value "$Location" 
}

Thanks!

Import CSV list of servers into RDM

avatar
avatar

Oh I now see the pinned post with some info on this. Going to take a look at that now

Import CSV list of servers into RDM

avatar
avatar

Hello!

Traditionally I've maintained RDM as well as a separate list of servers via a CSV file. I'd like to move away from the CSV file and import any servers on the CSV but not in RDM already. Does anyone have and ideas on how to best loop through both RDM and the CSV and create RDM entries for those that don't have on already? The CSV also has some other info such as Department and Use that I'd like to import as custom fields, so if those can be imported as well, that would be a bonus!

Thanks,

1 - 22 of 22 items