Get-RDMSession Error Suppression
Strange situation. First time I ran your cmdlet:
try {Get-RDMSession -Name "doesnotexist"} catch {write-host "session does not exist"}
It still gave me an error, then it worked as expected.it, including this morning.
As for the Synchronizer, I had not found that feature. I tried it with VMWare, and it did sync all the VMs. However, there are two problems.
- it did not create the folder structure. All VMs were dropped into a single folder.
- you can only have one connection type - VMConsole, or RDP. I have Windows and Linux, so I want them to have either RDP or SSH based on the guest OS.
Guess for now, I'll have to stick to my Powershell script.
Thanks,
Des
Get-RDMSession Error Suppression
Hi,
I have a script that reads all of out VMs out of vSphere, and creates RDP or SSH Sessions within RDM. After getting the list of VMs, the process calls Get-RDMSession to test if that session already exists within RDM.
$Exists = Get-RDMSession -Name $VMList[0].Name -Group $VMlist[0].GroupName
What is causing a problem is the situation when that Session does not exist. I have tried the following to suppress the error from displaying:
$Exists = Get-RDMSession -Name $VMList[0].Name -Group $VMlist[0].GroupName -ErrorAction Ignore
$Exists = Get-RDMSession -Name $VMList[0].Name -Group $VMlist[0].GroupName -ErrorAction Stop
$Exists = Get-RDMSession -Name $VMList[0].Name -Group $VMlist[0].GroupName | Out-Null
I have tried wrapping this in a Try/Catch but all to no avail. The error always displays on the screen.
Any ideas?
This has been tried on the latest version (2019) on both Server 2012R and Win 10.
Thanks,
Des
Setting Credential Type on Folders (Groups)
Thank you. That helped.
I discovered where my problem was lying. The object I was getting from VMWare had three pieces of info:
1 - Name of the VM
2 - Folder it was located in, in the format "Top\Next\Final"
3 - The OS the VM was running
When I created the Session. I used the Name for both the HOST and NAME field.
I used the "Folder" for the GROUP. The cmdlet was smart enough to create the full tree structure of folders: Top -> Next -> Final.
The problem that was throwing me, is that NONE of those folders, has an ITEM TYPE. Using the command above, produce no result. However, I can see the structure in the GUI.
When I created a FOLDER in the GUI, or by specifying the GROUP Type in Powershell, I was able to find those Folders that I created.
So, it looks like I will need to script this to create the Folder structure first, then add the Sessions to the already created folders.
Thanks for all the help.
Appreciated,
Des
Setting Credential Type on Folders (Groups)
All via Powershell so it can be run via scheduled task at night to update with any new systems.
Setting Credential Type on Folders (Groups)
Thanks. I can see how to do it in the GUI, but I am looking to do with via Powershell.
Basically, I am exporting my VM and Folder structure from vSphere and import that as Groups and Sessions in RDM.
I can do that with a full import, except for setting the "Inherit" option on the Groups. (I can set it on the Sessions)
But I want to keep this updated nightly, so I need to set this in the script.
Setting Credential Type on Folders (Groups)
I am looking for a method to change the Credential type on Folders to "Inherited".
I am adding a large number of Sessions to a DataSource stored in SQL. When I do so, it creates all the "Groups". I can change the Creds on the Sessions without a problem. However, I can't see a way to go it on the Folders (Groups).
From looking around, it appears that the Get-RDMSession cmdlet used to have a -Type parameter. But it no longer appears to.
Help appreciated.
Des