Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Icon management
#1
In vRD2011/2012 I had a neat trick to bulk update connection icons based on connection type so I could easily distinguish say, SSH from Telnet connections
I simply ran a daily job on the SQL server with commands like

-- ssh

UPDATE [VRDDB].[dbo].[vRDConnections]
   SET IconId = '7dc03bc1-ee74-4c8a-b7f7-98837293dcd0'
 WHERE DefaultProtocol = '3'

 
Each protocol including Ext Apps got its own icon. Easy!
 
So now the database looks very different and I understand it is necessary to use Powershell-API to interact with the data in there.
 
Now I need to be a Powershell Guru to manage ASG. Is there a capability to update connection icons in the current release? None of the Powershell commands seem to offer any help/examples... is that coming soon?

 
Reply
#2
Yes it is possible - but perhaps one cmdlet is missing for doing it very easy - a "GetAll"-command to get all connections - we will add it for the next release - then you can write a foreach => update statement
Regards/Gruss
Oliver
Reply
#3
(16-02-2018, 10:08 AM)DevOma Wrote: Yes it is possible - but perhaps one cmdlet is missing for doing it very easy - a "GetAll"-command to get all connections - we will add it for the next release - then you can write a foreach => update statement

Perfect, thank you.
Reply
#4
Ok - next patch will include the new cmdlet and here is the script you can use


Code:
$workingdir = "c:\Program Files\ASG-Remote Desktop 2018\"
Set-Location $workingdir
[Environment]::CurrentDirectory = Get-Location -PSProvider FileSystem
$path = $workingdir + "ASGRD-PSAPI.dll"
Add-Type -path $path
[reflection.assembly]::LoadFrom($path) | Import-Module

Connect-RDEnvironment -Environment YourEnvironment -PassThrough

ForEach( $Conn in Get-RDBaseItemAll -ItemType Connection )
{
 $Props = Get-RDPropertiesConnection -ItemId $Conn.ItemId
   
    if ($Props.Protocol -eq "SSH")
 {
  Set-RDBaseItem -ItemId $Conn.ItemId -ImageId 70082A54-918F-4BA9-B847-713A7CF4743B
 }
}
Regards/Gruss
Oliver
Reply




Users browsing this thread: 1 Guest(s)