Hi,
I want to import xml files using powershell but it gives error. I can import same xml files using RDM GUI without any errors. Any ideas?
Thank you. Best Regards.
PS C:\Program Files (x86)\Devolutions\Remote Desktop Manager> Import-RDMSession -Path "C:\RDM_xml\inventory.xml" -DuplicateAction Overwrite
Import-RDMSession : The type initializer for 'Devolutions.RemoteDesktopManager.Decorators.DecoratorManager'
threw an exception.
At line:1 char:1
+ Import-RDMSession -Path "C:\RDM_xml\inventory.xml" -DuplicateAction O ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-RDMSession], TypeInitializationException
+ FullyQualifiedErrorId : System.TypeInitializationException,RemoteDesktopManager.PowerShellModule.ImportRD
MSessionCommand
inventory.xml
Hello,
Thanks for reporting this. A ticket is opened at the engineering to get this fixed, unfortunately there is no workaround but to use the UI.
Sorry for the inconvenience, we'll post here when this is fixed.
Best regards,
Alex Belisle
Hi Alex,
Thank you. Best Regards.
any update on this request, I do have similar issue. I am using Enterprise RDM Setup.RemoteDesktopManager.2021.2.27.0. GUI works fine and I am trying to automate the import of the files weekly to keep our inventory upto date.
Getting the following error.
Import-RDMSession: Object reference not set to an instance of an object.
Hello,
Would it be possible to send the script you are running ?
Which version of the PowerShell module are you using ?
We are now using a PowerShell module that has been separated from RDM so maybe something would need to be changed.
Best regards,
Eric
Eric St-Martin
Was a resolution found for this issue? I'm having the same issue version 2022.2.20
PS> Import-RDMSession -Path "C:\RDMTemplate\inventory.rdm" -DuplicateAction Overwrite
The command above runs without error but is unsuccessful, importing using the GUI works as expected
Best,
Rob
Hello Rob,
The following should work, I just tested it on my end. If you want to import the files in the root, specify -Group "", else point it to the folder you want to import into. You can then save the import with the Set-RDMSession cmdlet.
$import = Import-RDMSession -path "path\of\file.rdm" -DuplicateAction Overwrite -Group "" Set-RDMSession -Session $import
Best regards,
Richard Boisvert