Hello Mr Ramamurthy R S,
Thank you for posting in Microsoft Community forum.
You are currently in a composite environment involving VPN connectivity as well as remote desktop services. I have two scenarios for your reference.
First,by remote desktop services to allow only selective clients to access Windows Server 2022 through Remote Desktop, you can follow these steps:
- Create a new security group in Active Directory for the users who need access to the server through Remote Desktop.
- Add the users who need access to the new security group.
- On the server, open the Local Security Policy editor by typing "secpol.msc" in the Run dialog box.
- Navigate to Local Policies > User Rights Assignment.
- Double-click on "Allow log on through Remote Desktop Services" and add the new security group you created in step 1.
- Remove the "Remote Desktop Users" group from the list of users who are allowed to log on through Remote Desktop Services.
- Ensure that the VPN connection is required to access the server.
After completing these steps, only the users who are members of the new security group will be able to access the server through Remote Desktop. If you are still experiencing issues with other computers being able to access the server, you may need to check your network configuration to ensure that the VPN connection is properly configured and that public network access is blocked.
Second, you can use Windows Firewall to create a rule that allows Remote Desktop traffic only from the IP addresses of the 15 PCs that you want to allow access.
Here are the steps to create the firewall rule:
- On the Windows 2022 server, open Windows Firewall with Advanced Security.
- Click on "Inbound Rules" in the left pane, and then click "New Rule" in the right pane.
- In the New Inbound Rule Wizard, select "Custom" and click "Next".
- In the "Program" screen, leave the default setting of "All programs" and click "Next".
- In the "Protocol and Ports" screen, select "TCP" and enter "3389" as the port number (this is the default port used by Remote Desktop). Click "Next".
- In the "Scope" screen, under "Remote IP address", select "These IP addresses" and click "Add". Enter the IP addresses of the 15 PCs that you want to allow Remote Desktop access from, and click "OK". Click "Next".
- In the "Action" screen, select "Allow the connection" and click "Next".
- In the "Profile" screen, select the appropriate network profiles (e.g. Domain, Private, Public) and click "Next".
- In the "Name" screen, enter a name for the rule (e.g. "Allow Remote Desktop from select PCs") and click "Finish".
Once you have created the firewall rule, only the 15 PCs whose IP addresses are listed in the rule will be able to access the Windows 2022 server through Remote Desktop. Other PCs on the VPN-connected network will be blocked by the firewall rule.
It's important to note that you should test the firewall rule in a non-production environment before deploying it on your live network, and make sure that you have a backup plan in case any issues arise.
I hope the information above is helpful.
If you have any question or concern, please feel free to let us know.
Best Regards,
Haijian Shan