RDM Enterprise 10.6.7.0
SQL data source
Caching disabled on data source due to being unreliable (found that the cache would frequently corrupt and only show a partial session list)
I have written a PowerShell script to managed sessions within RDM, using the RDM snap-in cmdlets. One of its functions is to delete any empty groups it finds. I have attempted the following commands:
Remove-RDMSession -ID <groupID> -Force
Remove-RDM-Session -ID <groupID> -Force
Neither one seems to work properly. Given an array of group IDs, some of the groups may get deleted, but not all, and some refuse to be deleted at all. Closer inspection revealed that groups that still appear after the delete command are actually getting new GUID values in their ID property immediately after the delete command is run, as if they were being deleted and immediately recreated. After numerous attempts at deleting several empty groups, I got down to two that neither command would work on, but I was able to finally delete them manually via the GUI.
Could somebody please explain why the application insists on intermittently recreating these groups instead of actually deleting them?
please consult
http://help.remotedesktopmanager.com/howto_folderstructure.htm
I suspect you have used virtual folders without knowing about them
Maurice
Oops, somehow that replied as guest. This forum seems to have a very short timeout period for logins.
Hello,
We have assigned a bug to a developer, he will look into this next week.
Best regards,
Maurice
Thanks. Here's some additional details that might be helpful.
The script I've written is responsible for building and managing an RDP session list in RDM based on computer data from our Kaseya management system, which organizes computers under what it calls machine groups. The script builds a tree of groups in RDM that emulate the Kaseya machine group hierarchy. The entire sync process goes something like this:
1. Load array of computers from Kaseya (SQL data loaded into custom objects).
2. Load array of all RDM sessions using Get-RDMSession, and filter into separate arrays for group sessions and RDP sessions.
3. Get list of all parent machine groups for all computers from Kaseya.
4. If any groups found in step 3 do not exist in RDM, create them via Add-RDMGroup.
5. Compare list of computers from Kaseya to RDP sessions in RDM.
6. If any computers do not have corresponding RDP sessions in RDM, create those sessions via New-RDMSession, setting the Group property to the appropriate parent group in RDM that matches the computer's Kaseya machine group.
7. For computers that do have matching RDP sessions (matched on hostname), if RDM group does not match computer's current Kaseya machine group, perform the following commands to change its group (RDP session from RDM is already loaded in $Session variable):
$Session.Group = "newgroupname"
$Session | Set-RDMSession
8. If any RDP sessions are found that there is no longer any matching computer for in Kaseya, delete them using Remove-RDMSession.
9. With all RDP session updates complete, refresh full list of current sessions from RDM using Get-RDMSession.
10. Check for any groups/folders in RDM that are now empty due to all RDP sessions being moved to other groups.
11. Delete any empty groups found using Remove-RDMSession.
Everything about this script works perfectly, except for deletion of empty groups. Due to how the entire RDM folder structure is managed by script, the only reason an RDM group should end up empty is if a Kaseya machine group is deleted or renamed, thus causing all the RDP sessions in the matching RDM group to either be deleted or moved to other groups.
Hi Bradley,
In step 4, could you use New-RDMSession -Name "GroupName" -Kind "Group" instead of Add-RDMGroup.
Best regards,
Olivier Désalliers
Oh, oops, I was in a hurry and didn't realize that Add-RDMGroup is actually the name of my own custom function for creating group sessions, not an official cmdlet. Within that function, I actually do the following:
$RDMGroup = New-RDMSession -Name $GroupName -Kind 'Group' -Group $GroupFullName
$RDMGroup | Set-RDMSession
So it appears it's already doing what you suggest.
Hi Bradley,
Is it possible to send me your script via private message?
Best regards,
Olivier Désalliers
Sent, thanks!
Hi Bradley,
A fix for the Remove-RDMSession will be available in the next version.
Best regards,
Olivier Désalliers
Thank you!