displayName | name |
VirtualPC1 | 192.168.1.10 |
VirtualPC2 | 192.168.1.11 |
<?xml version="1.0" encoding="utf-8"?>
<RDCMan programVersion="2.7" schemaVersion="3">
<file>
<credentialsProfiles />
<properties>
<expanded>True</expanded>
<name>NorthServers</name>
</properties>
<group>
<server>
<properties>
<displayName>VirtualPC</displayName>
<name>10.10.10.15</name>
</properties>
</server>
<server>
<properties>
<displayName>VirtualMachine</displayName>
<name>10.20.90.7</name>
</properties>
</server>
</group>
</file>
<connected />
<favorites />
<recentlyUsed />
</RDCMan>
I have attempted todo so like by creating this PowerShell Script:$vms = Import-Csv -LiteralPath "C:\Temp\ServersList.csv"
[xml]$Template = Get-Content -Path 'C:\Temp\ServersQ.rdg'
$servers = $Template.RDCMan.file.group.server.properties
$Template.RDCMan.file.group.server.properties = $vms
Which throws me an error: "The property 'properties' cannot be found on this object. Verify that the property exists and can be set."ASKER
$VMList = $null
$xml = $null
$VMList = Import-Csv -Path C:\temp\SERVERSLIST.csv
$xml = [xml]::new()
$xml.Load('C:\temp\ServersQ.rdg')
$index = 0
$nodes = $xml.RDCMan.file.group.server.properties
foreach ($node in $nodes){
$node.displayName = $VMList[$index].displayName
$node.name = $VMList[$index].name
$index++
}
$xml.save('c:\temp\servers.rdg')
Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.
TRUSTED BY
https://devolutions.net/solutions/remote-connection-management