To change an RDP port on a Windows device, you would need to follow below steps:
- Go to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
- On the right-hand side, Double-click on PortNumber and change the value from 3389 to some other custom value for example 3390 or whatever you want to set.
Now, How to perform this using Intune?
- You have two options for making this registry change. Firstly, you could deploy a standalone PowerShell script that makes the necessary modifications. Alternatively, you can utilize Intune remediations, which also involve a PowerShell script. However, the Intune method requires both a Detection Script and a Remediation Script. The Detection Script checks the current value of the Portnumber registry entry, and if it's not set to the desired value, the Remediation Script is executed to make the necessary changes.
- Regardless of the method you choose, you can use it to update the default RDP port number on Intune-managed Windows devices.
There are several reference guides available to assist you with PowerShell scripts and Intune Remediations if you choose to go that route. Please be aware that Intune remediations require your organization to meet specific licensing requirements. If these requirements are not met, you can opt to deploy a standalone PowerShell script using Intune to make the necessary changes.
You can easily create one using the reference guides provided below:
- https://cloudinfra.net/how-to-create-a-registry-key-and-values-using-powershell/
- https://cloudinfra.net/powershell-to-test-if-registry-key-and-value-exists/
- https://cloudinfra.net/how-to-create-registry-keys-using-intune-remediations/
- https://cloudinfra.net/how-to-deploy-a-powershell-script-using-intune/
--If the response is helpful, please click "Accept Answer" and upvote it.--