When building complex network configurations with Server 2016 you will need to adjust sometimes configuration settings that are not that easily to change in the GUI.
Suppose I have a big S2D cluster Or a NLB farm
In this configuration I have a Cluster that is using Storage spaces direct #S2D but On the SMB nic I don’t want to connect with RDP
Or in the NLB farm I want to use a NLB nic that is used for RDP.
with the Get-NetIPInterface we get a listing of the networks
Get-NetAdapter shows us the name and nic name
Our net step is list the current configuration and his settings for the Ports, in this case RDP
# list current settings
gwmi Win32_TSNetworkAdapterSetting -filter “TerminalName=’RDP-Tcp’” -namespace “root/cimv2/TerminalServices” | Select NetworkAdapterLanaID,NetworkAdapterName
ID 0 which is “All network adapters configured with this protocol”
More info about Win32_TSNetworkAdapterSetting can be found here :
https://msdn.microsoft.com/en-us/library/aa383811(v=vs.85).aspx
when we combine this in a variable to get some more info
#show netadapter bindings for RDS
$MVPRDP = gwmi Win32_TSNetworkAdapterSetting -filter “TerminalName=’RDP-Tcp’” -namespace “root/cimv2/TerminalServices”
$MVPRDP | select -expand DeviceIDList
As this is the network name it is not that handy use this with the get-netadapter
$MVPRDP | select -expand NetworkAdapterList
Now we know what to set on which adapter
# ID 0 which is “All network adapters configured with this protocol”. 0,1,2,3
SO ID 0 is all and start counting with 1 as I want RDP only on my MGT lan I set this on Adapter 2
$MVPRDP.SetNetworkAdapterLanaID(2)
gwmi Win32_TSNetworkAdapterSetting -filter “TerminalName=’RDP-Tcp’” -namespace “root/cimv2/TerminalServices” | Select NetworkAdapterLanaID,NetworkAdapterName
now a little reboot and just to make sure there are no old connections and your done.
Or use a register key to set this option but what fun is that.
set HKEY_LOCAL_MACHINESYSTEMControlSet001ControlTerminal ServerWinstationsRDP-tcpLanAdapter
Follow Me on Twitter @ClusterMVP
Follow My blog https://robertsmit.wordpress.com
Linkedin Profile Http://nl.linkedin.com/in/robertsmit
Google Me : https://www.google.nl
Bing Me : http://tinyurl.com/j6ny39w
LMGTFY : http://lmgtfy.com/?q=robert+smit+mvp+blog
Filed under: Windows Server 2016 Tagged: Windows Server 2016