Hi i'm looking for a way to make a powershell loop that will go through sessions and will pretty much simulate the "Infromation>load from inventory" button.
I can loop through the sessions now i only need to find a way to initiate the load from inventory any ideas how?
thank you !
Hi,
We don't have way of doing this for now.
Regards
David Hervieux
Although it is not available through Powershell, it is present in our Batch Actions, maybe that could help out until we can look at implementing it in Powershell.
Multi-select the sessions, edit - batch edit - batch actions, then Load from inventory
At least it will do a bunch of them at once.
Best regards,
Maurice
Maurice,
My problem is that i want to run it on schedule for example i want to run it on all sessions once a week
is there a way to do that from batch actions?
Hi,
This is not possible for now but we will soon start to work on something that could be doing that.
Regards
David Hervieux
Not entirely sure if there are any other threads on the topic of exposing 'load inventory' functionality outside of the client; however, I for one would love to see this feature. In our organization we have well over 2500+ machines we're managing and manually running 'load inventory' against them individually (or even with 'batch edit') is tedious and/or unreliable for a large number of sessions. For example yesterday I kicked off an overnight 'load inventory' using 'batch edit' against a small sampling of our server farm (about 200) and it died about half way through. Might just have been my experience; however, it'd be much easier to incorporate a PowerShell cmdlet into the nightly sync and maintenance scripts we're already running.
If there has been any traction on this I'd love to hear about it. :)
Hi,
There is a cmdlet called Invoke-RDMLoadFromInventorySession in the PowerShell module.
You can pass any session in the Session parameter and it will invoke the "Load from inventory" action on it.
For example:$mySession= Get-RDMSession -Name "MySessionName"Invoke-RDMLoadFromInventorySession -Session $mySession Set-RDMSession -Session $mySession -Refresh
For more information, you can visit the help page about this cmdlet: https://help.remotedesktopmanager.com/index.html?invoke-rdmloadfrominventorysession.htm
Best regards,
Olivier Désalliers
Perfect! Thanks for the quick response.
Had an opportunity to use the 'Invoke-RDMLoadFromInventorySession' cmdlet and I'm running into an odd issue. Whenever I run the cmdlet it completes almost immediately and doesn't run the inventory. Adding the '-debug' flag is showing that the session is being "ignored" (ex: VERBOSE: Ignored TESTSERVER session')
Here's the test script I've ran:
$tsObj = Get-RDMSession -GroupName 'DevOps' -IncludeSubFolders | ? {$_.Name -eq 'TESTSERVER' }
Invoke-RDMLoadFromInventorySession -Session $tsObj -Verbose -Debug
Set-RDMSession -Session $tsObj -Refresh
If I kick off the inventory manually using the UI it works fine. Any idea what could be the issue?
Also, if this isn't the best place for this question let me know the correct forum and I'll re-post.
Thanks again.
Hi,
What is "TESTSERVER" session type?
Best regards,
Olivier Désalliers
I'm not explicitly declaring the variable so PS creates it as [System.Object[]]'
Hi,
I mean Get-RDMSession returns a session that is in your data source named "TESTSERVER" in your case. This session has a type (RDP, SSH, VNC, etc). What is it?
Best regards,
Olivier Désalliers
Ah ok. All of the sessions I've tried are 'RDP' sessions ('RDPConfigured')
Hi,
We have been able to reproduce your issue.
We will investigate it.
Best regards,
Olivier Désalliers
Thanks for the update.
Hi,
A fix for the issue in the Invoke-RDMLoadFromInventorySession cmdlet will be available in the next version.
Best regards,
Olivier Désalliers
Looking forward to it :) Thanks again for the prompt response.
I installed the new client version that was released today (12.6.5.0) but unfortunately I'm still getting the 'ignored' session error.
Hi,
The fix is not 12.6.5.0 but the next version one.
Sorry for the confusion.
Best regards,
Olivier Désalliers
Thanks for the update
Hi Olivier,
I've updated to 12.6.6.0.
When i'm trying to initiate a load from inventory
Get-RDMSession -Name "TESTSERVER" | Invoke-RDMLoadFromInventorySession -Verbos
e -Debug
I get the following
VERBOSE: Load from inventory - TESTSERVER
VERBOSE: Success: False - TESTSERVER
When I run it from the GUI it works without any issues.
Any ideas?
For my original testing I created a test session named 'TESTSERVER'. For your testing I would suggest using an existing session. After the v12.6.6.0 update 'Invoke-RDMLoadFromInventorySession' works as expected.
Thanks for the quick turnaround Olivier.
I replaced original session name for privacy i've used the actual session name in my script and it doesnt seem to work.
Hi,
What is the session type?
Do you have this issue with all the sessions you tried?
Best regards,
Olivier Désalliers
A regular RDP session.
Hi,
What is your credentials type?
Can you try to create a rdp session with the credentials in the session username and password fields?
Best regards,
Olivier Désalliers
Hi Olivier -
I may have claimed success prematurely. After opening a new PS ISE session I tried the 'Invoke-RDMLoadFromInventorySession' again and it wasn't success (different error)
'VERBOSE: Success: False - TESTSERVER'
I tried in both 32-bit and 64-bit PS ISE sessions, rebooting my system and reinstalling RDM v12.6.6.0; no joy.
Any suggestions?
Hi,
What is your credentials type?
Do you have the same problem when trying the way I previously said:
Can you try to create a rdp session with the credentials in the session username and password fields?
Best regards,
Olivier Désalliers
Ok. Credentials are inherited from the parent folder. The parent folder is set to 'My Personal Credentials'. When I set the credentials to 'default', set the 'username' & 'domain' fields, and store the password in the database it works. Progress!
Hi,
The credentials resolving is not supported by this cmdlet.
We will add the credentials resolving in Invoke-RDMLoadFromInventorySession
Best regards,
Olivier Désalliers
Ran a few more tests. Definitely seems like there's an issues (maybe user-related) to how the cmdlet handles the different credential settings. It would be great if the cmdlet accepted PS credential objects as an option. Any chance this is on your feature roadmap?
Hi,
We added the credentials resolving for the cmdlet Invoke-RDMLoadFromInventorySession.
It's available in RDM 12.6.7.0.
Best regards,
Olivier Désalliers
Awesome. Thanks Olivier. Any chance the cmdlet will support PS credential objects in the future?
Hi,
I can understand that this parameter would be useful in the case you have chosen "prompt for credentials" in your session for example.
In the case the session already has credentials and you would provide credentials with the parameter, the credentials from the parameter will take priority over the credentials already in the session.
Is it the way you were thinking of it?
Best regards,
Olivier Désalliers
Correct. Here's the background...
Our company has a centralized Identity and Access Management (IAM) security tool that requires a special configuration to open an RDP session. The user's credentials (what's stored in RDM) are not the credentials actually used for the RDP session. For example if a user (i.e. 'CORP\bob') wants to remote to a server, he authenticates to the IAM tool and then the IAM tool establishes the connection with a different account associated with his username (i.e. 'CORP\IAM_bob'). 'CORP\bob' cannot RDP directly to the server. Our RDM sessions are set up to jump this hurdle and the end users are none the wiser.
My team uses service accounts for our automation, and these accounts have permission to connect directly to our servers (bypass IAM access) so I'd like to use these credentials for invoking 'Invoke-RDMLoadFromInventorySession'. If I can't pass in a PS credential object, the only other option I have (I think) is to duplicate our existing session tree and have all the entries use one of our automation accounts.
Hi,
Thank you for the explanation.
We will add this to our TODO list.
Best regards,
Olivier Désalliers
Excellent! Much appreciated :)
Hi,
We added the parameter Credential in Invoke-RDMLoadInventoryFromSession.
Ex:$session = Get-RDMSession -Name 'TESTSERVER'$mycreds = New-Object System.Management.Automation.PSCredential ("username", (ConvertTo-SecureString "password" -AsPlainText -Force))Invoke-RDMLoadFromInventorySession -Session $session -Credential $mycreds -Verbose
It will be available in the next RDM version.
Best regards,
Olivier Désalliers
Thanks Olivier. Being able to use alternate credentials will be extremely helpful. I'm looking forward to the next release!
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
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?
Thanks.
@angelfire,
Thank you for opening a new thread here https://forum.devolutions.net/topics/37068/powershell--load-from-inventory
My team will reply soon in this new thread.
Best regards,
Jeff Dagenais