

However, configuring remote access on the Internet for multiple computers on the same network is not so intuitive. Then to access the Internet, we need to go to the port entry section on the Network Router (very simple). Everything will appear on the remote computer as if it is present in front of the host computer.Ĭonfiguring computers to make connections of this type is very simple - the job you need to do is just check the checkbox. Invoke-Command -ComputerName $PC.Network administration - Remote desktop connections can be accessed from these computers to a desktop, program or file of any computer whether it is in the next room or on the other end of the earth. $PCs = Get-ADComputer -Filter * -SearchBase "CN=IT,CN=Computers,CN=NY,DC=woshub,DC=com" If you need to change the RDP number remotely on multiple computers in your AD domain (in the specific OU), use the following script (you can get a list of computers in the OU using the Get-ADComputer cmdlet): Invoke-Command -ComputerName wksname112 -ScriptBlock To do this, you need to enable WinRM on the remote computer, and then you can use the Invoke-Command cmdlet to connect to the computer: You can change the RDP port number on a remote computer. Write-host "The number of the RDP port has been changed to $RDPPort " -ForegroundColor Magenta New-NetFirewallRule -DisplayName "NewRDPPort-UDP-In-$RDPPort" -Direction Inbound –LocalPort $RDPPort -Protocol UDP -Action Allow New-NetFirewallRule -DisplayName "NewRDPPort-TCP-In-$RDPPort" -Direction Inbound –LocalPort $RDPPort -Protocol TCP -Action Allow Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-TCP\" -Name PortNumber -Value $RDPPort Write-host "Specify the number of your new RDP port: " -ForegroundColor Yellow -NoNewline $RDPPort = Read-Host

Change RDP Listening Port Number with PowerShellĪ complete PowerShell script to change the RDP port number, create the firewall rule, and restart the Remote Desktop service might look like this: Create a new GPO that will deploy the PortNumber registry parameter with the new RDP port number to domain computers. If you want to change the RDP port number on domain computers, you can use the Group Policy features.
#Rdp port redirection nla windows
If you change the default RDP listening port number, you may have some troubles with using Remote Assistance, shadow RDP connections in Windows 10, as well as RDS shadowing on Windows Server.
