We're trying to automate a monthly update of the assets in RDM through Powershell and the commands seem to execute without errors but, aside from the "Last Load" time in the Asset tab, it doesn't appear to be collecting the new data. Here are some of the details.
RemoteDesktopModule version 2022.1.0.6
Using the code below:
$ds = get-rdmdatasource -name RDM
set-rdmcurrentdatasource $ds
$sessions = get-rdmsession | ? ConnectionType -eq 'rdpconfigured'
# verified that the correct data is being returned from these commands
$mycred = (get-credential) #Our regular accounts do not have local admin rights so I answer this with my elevated credentials
invoke-rdmloadfrominventorysession -session $sessions[0] -credential $mycred -verbose -debug #Only feeding the first session in the array for testing and verified that it is a valid server
set-rdmsession -session $session[0] -refresh
update-rdmui
====
The invoke command produced this output:
VERBOSE: Load from inventory - SERVER01
VERBOSE: Retrieving System Information with for SERVER01 with the user mydomain\myprivaccount
VERBOSE: Success: True - SERVER01
Connection ErrorMessages Success
---------- ------------- -------
RemoteDesktopManager.PowerShellModule.PSOutputObject.PSConnection {} True
There is no error reported or logged in the error messages property yet there is no data update in RDM except for the Last Load time as stated above. Am I missing some part of the process? When using the button in the GUI to refresh the Asset's inventory, it takes a while to query and populate. The Powershell line for RDMLoad returns a success immediately. This may mean that the command has been passed successfully as a collection job and it will take time to update the database but even if I wait 15 minutes before the session refresh and update-rdmui, I still don't have data. Closing and reopening the app also does not update. Since the RDMLoad with the debug switch doesn't report any errors, I am uncertain where things are failing.
Thanks.
Hello,
I ran some tests on my side and I seem to be getting the same issue you are having.
I have gone ahead and opened a ticket with our engineering team working on the module to investigate.
Once I hear back from them I will update you in this forum.
Best regards,
Eric St-Martin
Hi,
Based on my testing, you can retrieved the inventory information like this.
$inventory = Invoke-RDMLoadFromInventorySession -session $sessions[0]
$inventory.Connection.MetaInformationLet me know if this helps.
Regards
Jonathan Lafontaine
Thanks for the suggestion Jonathan. I tried it from the top and though $inventory.Connection.MetaInformation does return properties, they are largely empty. The IP address for the server is filled out as is the LastLoadFromInventoryDate but that is all. When I choose the "Load From Inventory" button under assets in the interface, it takes about 30 seconds and then numerous fields are populated including Software details, Hardware details, etc. I have not had success reproducing this result from the Powershell commands. The first attachment is the result from the commands. The second is the result of viewing the MetaInformation from another server in the rdmsession collection. ($sessions[10].MetaInformation) This is a sample of the data that is populated when using the GUI instead of Powershell.
Checking to see if there is any update. Thanks.
Hi,
Unfortunately no, but your issue is high on my priority list.
Jonathan Lafontaine
Hi,
I have good news for you.
I've reworked Invoke-RDMLoadFromInventorySession to be compatible with the new .net core PowerShell module.
It will only work on Windows but with version 2022.1.1.0, you should be able to retrieve inventory information like you used to.
Let me know how it goes
Regards
Jonathan Lafontaine
Jonathan,
I've become so accustomed to a Powershell 7.x workflow that I never thought to do any testing in 5.1. I tested the workflow a moment ago and it works as expected with 2022.1.1.0.
Many, many thanks.
Angel F.
2022.1.1.0 should be able to retrieve the inventory in PS7.2 too.
Jonathan Lafontaine
Confirmed. Thanks again.
My pleasure.
Glad it works.
Jonathan Lafontaine