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. First get a reference to the instance of the class. So you're left with using SetNetworkAdapterLanaID and which requires an integer ID value as an argument to the method. 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. In my experience, SetNetworkAdapterLanaID is more reliable than SelectNetworkAdapterIP because of the "All network adapters" option. There are 3 methods associated with the class that you can use: The specific class that has what you need is called Win32_TSNetworkAdapterSetting. But if I recall correctly, your best bet is to just limit the connections using the built-in firewall. If that's what you're looking for, there are other ServerFault questions with answers more detailed. It's a somewhat common request on machines that only have one adapter and multiple IPs. I just wanted to clarify for others who might stumble onto this question. 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. Here's a good place to start on browsing what's available: Remote Desktop Services Configuration classes As of Vista/2008, it's located in the root\cimv2\TerminalServices namespace. Remote Desktop Services actually have a pretty rich WMI object library you can take advantage of to query and manipulate the configuration.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |