Forum / Remote Desktop Manager - PowerShell Repository

Initiate Load From Inventory via Powershell

  • Create an Issue
  • Cancel

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 !

Clock4 yrs

Hi,
We don't have way of doing this for now.

Regards

David Hervieux

signaturesignature

Clock4 yrs

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 Côté

signaturesignature

Clock4 yrs

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?

Clock4 yrs

Hi,
This is not possible for now but we will soon start to work on something that could be doing that.

Regards

David Hervieux

signaturesignature

Clock4 yrs

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. smile

Clock3 yrs

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

signaturesignature

Clock3 yrs

Perfect! Thanks for the quick response.

Clock3 yrs

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.

Clock3 yrs

Hi,

What is "TESTSERVER" session type?

Best regards,

Olivier Désalliers

signaturesignature

Clock3 yrs

I'm not explicitly declaring the variable so PS creates it as [System.Object[]]'

Clock3 yrs

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

signaturesignature

Clock3 yrs

Ah ok. All of the sessions I've tried are 'RDP' sessions ('RDPConfigured')

Clock3 yrs

Hi,

We have been able to reproduce your issue.

We will investigate it.

Best regards,

Olivier Désalliers

signaturesignature

Clock3 yrs

Thanks for the update.

Clock3 yrs

Hi,

A fix for the issue in the Invoke-RDMLoadFromInventorySession cmdlet will be available in the next version.

Best regards,

Olivier Désalliers

signaturesignature

Clock3 yrs

Looking forward to it smile Thanks again for the prompt response.

Clock3 yrs

I installed the new client version that was released today (12.6.5.0) but unfortunately I'm still getting the 'ignored' session error.

Clock3 yrs

Hi,

The fix is not 12.6.5.0 but the next version one.

Sorry for the confusion.

Best regards,

Olivier Désalliers

signaturesignature

Clock3 yrs

Thanks for the update

Clock3 yrs

Olivier Désalliers wrote:

Hi,

The fix is not 12.6.5.0 but the next version one.

Sorry for the confusion.

Best regards,


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?

Clock3 yrs

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.

Clock3 yrs

Shannon Naulls wrote:

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.

Clock3 yrs

Hi,

What is the session type?

Do you have this issue with all the sessions you tried?

Best regards,

Olivier Désalliers

signaturesignature

Clock3 yrs

Olivier Désalliers wrote:

Hi,

What is the session type?

Do you have this issue with all the sessions you tried?

Best regards,


A regular RDP session.

Clock3 yrs

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

signaturesignature

Clock3 yrs

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?

Clock3 yrs

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

signaturesignature

Clock3 yrs

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!

Clock3 yrs

Hi,

The credentials resolving is not supported by this cmdlet.

We will add the credentials resolving in Invoke-RDMLoadFromInventorySession

Best regards,

Olivier Désalliers

signaturesignature

Clock3 yrs