If you ever had to add multiple values to the Gateway Managed Computer Groups there is really only one way of doing it quickly and easily and that’s via powershell. The script below enters an existing group and then loops in order to add all the ip addresses from a /24 CIDR. Since you can’t add subnets or ip ranges you have to add every single address which in this case is 255 addresses, without powershell this will be a nightmare.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
$GroupName = "Lab"
Import-Module RemoteDesktopServices
cd RDS:\
cd GatewayServer
cd GatewayManagedComputerGroups
cd $GroupName
cd computers
for($i = 1; $i -lt 256; $i++){
New-Item -Name "10.0.1.$i" -Type "String"
}
|