How to Change RDP port in Windows Server via Powershell CLI

Open Powershell as Administrator Change RDP port: Set-ItemProperty -Path “HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\” -Name PortNumber -Value 3391 Check current port: (Get-ItemProperty -Path “HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\” -Name PortNumber).PortNumber  

Disable Windows Server Update via Powershell/CLI

Create a file with notepad and paste below code, rename file as disable_update.ps1 then open Powershell as Admin then run it ./ps1 $WUSettings = (New-Object -com “Microsoft.Update.AutoUpdate”).Settings $WUSettings.NotificationLevel=1 $ $WindowsUpdatePath = “HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\” $AutoUpdatePath = “HKLM:SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU” If(Test-Path -Path $WindowsUpdatePath) { Remove-Item -Path $WindowsUpdatePath -Recurse } New-Item -Path $WindowsUpdatePath New-Item -Path $AutoUpdatePath Set-ItemProperty -Path $AutoUpdatePath -Name NoAutoUpdate -Value 1