Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a server with multiple network interfaces, and I need RDP to only listen for connections on one of them; the server is not a Remote Desktop server, RDP is only used for remote administration.

In Windows Server 2008 R2, I was able to configure this using the Remote Desktop Session Host console; in Windows Server 2012, that console isn't there anymore.

How can I configure this in WS2012?

share|improve this question
    
Not that you want to do it via the registry, but I suspect that HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\LanAdapter is still the right place. –  Zoredache May 8 '13 at 16:55
    
And how could I set that? –  Massimo May 8 '13 at 17:15
    
Not sure what to set the value to. I just know that is the value that changes on older versions of Windows when you adjust the setting. I figured you might be able to Google for that and find something. –  Zoredache May 8 '13 at 17:27
    
Did you find the solution? Posting it here might help others (like me) looking for the same thing. –  user209291 Feb 13 at 21:19

2 Answers 2

Remote Desktop Services actually have a pretty rich WMI object library you can take advantage of to query and manipulate the configuration. As of Vista/2008, it's located in the root\cimv2\TerminalServices namespace. Here's a good place to start on browsing what's available: Remote Desktop Services Configuration classes

In regards to your specific question, I'd just like to clarify that RDP can only be bound to a network adapter, not a specific IP. I know you said "network interface". I just wanted to clarify for others who might stumble onto this question. It's a somewhat common request on machines that only have one adapter and multiple IPs. If that's what you're looking for, there are other ServerFault questions with answers more detailed. But if I recall correctly, your best bet is to just limit the connections using the built-in firewall.

The specific class that has what you need is called Win32_TSNetworkAdapterSetting. There are 3 methods associated with the class that you can use:

In my experience, SetNetworkAdapterLanaID is more reliable than SelectNetworkAdapterIP because of the "All network adapters" option. It seems like if it's currently configured to "All network adapters" it won't change to the specific adapter with the IP you specify, it will just keep it on "All network adapters" which is technically still correct.

So you're left with using SetNetworkAdapterLanaID and which requires an integer ID value as an argument to the method. So here's how you find the ID to use. First get a reference to the instance of the class. My example here will use the default terminal name called "RDP-Tcp", but it's possible (though unlikely) your systems have additional or different terminal names.

You can check the current status of what network adapter is configured with the following PowerShell:

gwmi Win32_TSNetworkAdapterSetting -filter "TerminalName='RDP-Tcp'" -namespace "root/cimv2/TerminalServices" | Select NetworkAdapterLanaID,NetworkAdapterName

In order to call a method, it's nice to have the instance of the class assigned to a variable, so let's do that:

$ts = gwmi Win32_TSNetworkAdapterSetting -filter "TerminalName='RDP-Tcp'" -namespace "root/cimv2/TerminalServices"

A handy feature of this class is that a couple of the properties it returns are lists of the possible network adapters you can use.

$ts | select -expand DeviceIDList
$ts | select -expand NetworkAdapterList

This should return two lists. The first is a 0-based list of IDs and the second is the friendly name of the adapters associated with the first list. So on my test machine, it returned:

0
1

and

All network adapters configured with this protocol
Intel(R) PRO/1000 MT Network Connection

By default, it's set to use ID 0 which is "All network adapters configured with this protocol". So if we wanted to change it to use the Intel NIC explicitly, we just have to call the method using our existing object and the associated ID.

$ts.SetNetworkAdapterLanaID(1)

You can then verify the change by re-querying the object:

gwmi Win32_TSNetworkAdapterSetting -filter "TerminalName='RDP-Tcp'" -namespace "root/cimv2/TerminalServices" | Select NetworkAdapterLanaID,NetworkAdapterName
share|improve this answer

As far as I know, the Remote Desktop Session Host is no longer exists in Windows Server 2012.

You can find some config of it in Server Manager --> Server Role

share|improve this answer
    
There are no roles on this server, it's not a Terminal Server; RDP is only used for remote administration. –  Massimo May 8 '13 at 17:15
    
Yeah, I know that. I just follow this article technet.microsoft.com/en-us/library/hh921475.aspx Hope this help. –  cuonglm May 8 '13 at 17:17
    
This is completely unrelated to RDP... –  Massimo May 8 '13 at 17:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.